I think you are trying to use a regular expression in the like phrase. I wasn't aware that MS SQL can do regular expressions at all? I've been using 2000 - perhaps the newer version can?

In MySQL, instead of saying:
LA.LastName LIKE '[A-E]%'
try this:
LA.LastName REGEXP '^[A-E]'

You can read more about MySQL regular expressions here: http:// mysql.com/doc/refman/5.0/en/regexp.html

Also, are you using spellcheck with Outlook Express? Because if so, Microsoft keeps trying to rename "MySQL" to be "Myself." I think they want to take over everything. :-)

Good luck.

Douglas Sims
[EMAIL PROTECTED]



On Aug 21, 2006, at 10:57 AM, Jesse wrote:

I have the following query which works in MS SQL Server, but I'm sure the syntax is different for Myself. I'm sure it's in the area of the "LIKE" clause. I don't know how to do this with Myself. Can anyone point me in the right direction?:

SELECT LA.FirstName,LA.LastName,LA.EMailAddress, LA.UserName, U.Password
FROM LocalAdvisors LA
   JOIN Users U ON U.UserName=LA.UserName
WHERE EMailAddress <> '' AND EMailAddress IS NOT NULL
AND (EMailPermission is NULL or EMailPermission=1) AND LA.LastName LIKE '[A-E]%'
ORDER BY LastName,FirstName

Thanks,
Jesse

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to