Solved

Microsoft JET Database Engine error '80040e14'  Syntax error (missing operator) in query expression

Posted on 2016-09-12
13
34 Views
Last Modified: 2016-09-13
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

0
Comment
Question by:Graeme
  • 6
  • 4
  • 3
13 Comments
 
LVL 49

Assisted Solution

by:Ryan Chong
Ryan Chong earned 250 total points
Comment Utility
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
 

Author Comment

by:Graeme
Comment Utility
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
 
LVL 49

Expert Comment

by:Ryan Chong
Comment Utility
>>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
 

Author Comment

by:Graeme
Comment Utility
Hi Ryan, I have just run the Query in the DB and it shows an error (same as previous)
0
 
LVL 49

Expert Comment

by:Ryan Chong
Comment Utility
hi, can you show the SQL generated here? is Access your database?
0
 

Author Comment

by:Graeme
Comment Utility
Yes Access is my database

nothing was generated from Query, just the error when I Run it
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 32

Assisted Solution

by:Big Monty
Big Monty earned 250 total points
Comment Utility
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
 
LVL 49

Expert Comment

by:Ryan Chong
Comment Utility
oppps and nice spotted on Big Monty
0
 

Author Comment

by:Graeme
Comment Utility
Thanks guys, works for the date, now just need to get the time part working 
0
 
LVL 32

Expert Comment

by:Big Monty
Comment Utility
For the time,  use the same format :

timeColumn >= timeParameter
0
 

Author Comment

by:Graeme
Comment Utility
Tried it with Now() and it didn't work
0
 
LVL 32

Accepted Solution

by:
Big Monty earned 250 total points
Comment Utility
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
 

Author Comment

by:Graeme
Comment Utility
Oh! Time works! Thanks BigMonty!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video discusses moving either the default database or any database to a new volume.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now