Graeme McGilvray
asked on
Microsoft JET Database Engine error '80040e14' Syntax error (missing operator) in query expression
Hi All, getting this error and not sure why I am, little help?
Microsoft JET Database Engine error '80040e14'
Syntax error (missing operator) in query expression 'event_code=code_short AND e.event_ID=s.event_ID AND event_location=location_ID AND event_live=TRUE AND session_date=>#13/9/2016# AND session_stime>#14:31#'.
/home2.asp, line 1214
TodayDate=Day(Now)&"/"&Month(Now)&"/"&Year(Now)
TodayTime=Hour(Now)&":"&Minute(Now)
Set NextEvent=oConn.Execute("SELECT * FROM events e,locations,codes,event_sessions s WHERE event_code=code_short AND e.event_ID=s.event_ID AND event_location=location_ID AND event_live=TRUE AND session_date=>#"&TodayDate&"# AND session_stime>#"&TodayTime&"# ORDER BY session_date,session_stime")
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>or did you mean directly in the database?
yes... directly in db.. put the "Now()" into your sql statement as part of the string.
you can also do this and tell us what is generated?
yes... directly in db.. put the "Now()" into your sql statement as part of the string.
you can also do this and tell us what is generated?
SQLstr = "SELECT * FROM events e,locations,codes,event_sessions s WHERE event_code=code_short AND e.event_ID=s.event_ID AND event_location=location_ID AND event_live=TRUE AND session_date=> now() "
response.write SQLstr
response.end
Set NextEvent=oConn.Execute(SQLstr)
ASKER
Hi Ryan, I have just run the Query in the DB and it shows an error (same as previous)
hi, can you show the SQL generated here? is Access your database?
ASKER
Yes Access is my database
nothing was generated from Query, just the error when I Run it
nothing was generated from Query, just the error when I Run it
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
oppps and nice spotted on Big Monty
ASKER
Thanks guys, works for the date, now just need to get the time part working 
For the time, use the same format :
timeColumn >= timeParameter
timeColumn >= timeParameter
ASKER
Tried it with Now() and it didn't work
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Oh! Time works! Thanks BigMonty!
ASKER
Open in new window
or did you mean directly in the database?