Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Access 97 problem

Status
Not open for further replies.

peekay

Programmer
Oct 11, 1999
324
ZA
I have the following query that I wish to run on a table named activities with the fields startdatetime as date,penddate as date,username as string,done as boolean :

Select * from activities where done=false and username='peka' and (isnull(penddate)=true and datevalue(startdatetime)=<#05-May-01#) or (isnull(penddate)=false and penddate>#05-May-01# and penddate<=#05-May-01#) order by startdatetime

I get the error Syntax error (missing operand)
Can somebody please help me with the correct syntax

PK Odendaal
pko@mweb.co.za

 
Hi,

Get rid of the datevalue() and change the =< to <=

Have a good one!
BK
 
BlackKnight and tlbroadbent.

Thanks for the tip. The <= did the trick. It is permissible and necessary in this case to keep the datevalue if you wish to compare only the date parts of the field.

Thanks.

PK Odendaal
pko@mweb.co.za

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top