Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 missing operator in date format

Author  Topic 

lsy
Yak Posting Veteran

57 Posts

Posted - 2007-03-21 : 22:42:33
i'm using vc to pass sql query to ms access database. my sql is like

SELECT DATEDIFF('s', [Start_Date], [End_Date]) AS AlarmTime FROM LogAlarm WHERE [Start_Date] BETWEEN #04/01/06 00:31:32 AM# AND #04/01/06 01:32:05 AM# AND [Alarm address] = '123'

but in my vc it prompt there are missing operator in the syntax color in red.
pls advice!!

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2007-03-22 : 05:44:40
only thing I can think of is to put '' around the date values (outside the #s)
Go to Top of Page

lsy
Yak Posting Veteran

57 Posts

Posted - 2007-03-22 : 21:08:33
i had try of it... but still the same...
Go to Top of Page

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2007-03-23 : 11:50:48
try getting it to work just with an "="
the problem may be with the BETWEEN keyword.
b between a and c
can be rewritten as
a >= b and b <= c
Go to Top of Page

lsy
Yak Posting Veteran

57 Posts

Posted - 2007-03-26 : 22:51:12
i got my things correct but the error is not come from the question that i post... i'm sorry to border you all and thanks for all the responds...
Go to Top of Page
   

- Advertisement -