Click to See Complete Forum and Search --> : "You have an error in your SQL syntax"


beta
04-17-2006, 08:55 AM
[MySQL][ODBC 3.51 Driver][mysqld-4.1.18-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Read='No'' at line 1


The line:

Set chck=dbcon.execute("SELECT Count(Msg_ID) AS Unread FROM Message WHERE MsgTo="&Session(""&Var_LadderAbbr&"_AccountID")&" AND Read='No'")


Any ideas?... :\

lmf232s
04-17-2006, 12:25 PM
"SELECT Count(Msg_ID) as Unread " & _
"FROM Message " & _
"WHERE MsgTo = '" & Session(Var_LadderAbbr & "_AccountID") & "' " & _
"AND Read = 'No'"

SELECT Count(Msg_ID) as Unread FROM Message WHERE MsgTo = '" & Session(Var_LadderAbbr & "_AccountID") & "' AND Read = 'NO'

beta
04-17-2006, 12:47 PM
Same error.

I came up with a way around which involved looping through the recordset but I;m still wondering why that error was showing with that string.