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

Open in new window

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")

Open in new window

Graemewebber4technologiesAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Big MontyConnect With a Mentor Senior Web Developer / CEO of ExchangeTree.org Commented:
Can you explain what you mean by "it didn't work"?  Otherwise it'll be impossible to narrow down the issue.

With that time column you try:

TimeColumn >= Time()

This will get all records after the current time.

Turning in for the night, good luck :)
0
 
Ryan ChongConnect With a Mentor Commented:
what if you try this directly?

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=> now() ")
0
 
Graemewebber4technologiesAuthor Commented:
Thanks for the Ryan, I get this error:
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=> now()'.

/home2.asp, line 1331

Open in new window


or did you mean directly in the database?
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Ryan ChongCommented:
>>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?

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) 

Open in new window

0
 
Graemewebber4technologiesAuthor Commented:
Hi Ryan, I have just run the Query in the DB and it shows an error (same as previous)
0
 
Ryan ChongCommented:
hi, can you show the SQL generated here? is Access your database?
0
 
Graemewebber4technologiesAuthor Commented:
Yes Access is my database

nothing was generated from Query, just the error when I Run it
0
 
Big MontyConnect With a Mentor Senior Web Developer / CEO of ExchangeTree.org Commented:
where you have

session_date=> now()

it should be session_date>= now()

notice it should be greater than or equal to, NOT equal to or greater than
1
 
Ryan ChongCommented:
oppps and nice spotted on Big Monty
0
 
Graemewebber4technologiesAuthor Commented:
Thanks guys, works for the date, now just need to get the time part working 
0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
For the time,  use the same format :

timeColumn >= timeParameter
0
 
Graemewebber4technologiesAuthor Commented:
Tried it with Now() and it didn't work
0
 
Graemewebber4technologiesAuthor Commented:
Oh! Time works! Thanks BigMonty!
0
All Courses

From novice to tech pro — start learning today.