Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2016-09-12
13
48 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 50

Assisted Solution

by:Ryan Chong
Ryan Chong earned 250 total points
ID: 41795561
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
ID: 41795618
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 50

Expert Comment

by:Ryan Chong
ID: 41795722
>>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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

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

Expert Comment

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

Author Comment

by:Graeme
ID: 41796307
Yes Access is my database

nothing was generated from Query, just the error when I Run it
0
 
LVL 33

Assisted Solution

by:Big Monty
Big Monty earned 250 total points
ID: 41796355
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 50

Expert Comment

by:Ryan Chong
ID: 41797140
oppps and nice spotted on Big Monty
0
 

Author Comment

by:Graeme
ID: 41797174
Thanks guys, works for the date, now just need to get the time part working 
0
 
LVL 33

Expert Comment

by:Big Monty
ID: 41797177
For the time,  use the same format :

timeColumn >= timeParameter
0
 

Author Comment

by:Graeme
ID: 41797182
Tried it with Now() and it didn't work
0
 
LVL 33

Accepted Solution

by:
Big Monty earned 250 total points
ID: 41797220
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
ID: 41797277
Oh! Time works! Thanks BigMonty!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
document.getElementById not worj with 2 IDs with the same name 10 51
If condition on Html with Asp 11 27
Filktering Alphabetically 8 29
Set time on Session (ASP) 14 21
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

809 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