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
 Help needed with AND OR in SQL Statement

Author  Topic 

Judda
Starting Member

7 Posts

Posted - 2001-11-05 : 16:25:18
Hi there,

I have an Access 2000 DB that hold dates as number like this:

20010101
20010102
20010103
20010104
20010105
20010106
etc

I want to select a range of these 'dates' depending upon wether or not they are greater or less than my search 'date'.

If I do this:

strSQL = "SELECT * FROM [calendar] WHERE [cdate] >= '" & targetdate & "' AND [cdate] <= '" & targetdate & "'"

My query finds nothing !

If I swap the AND for an OR I get some results but not the correct number (as I would expect).

Does anyone have any ideas on what I am doing wrong here ?

The app I am doing is in VB6 (SP5)

Many thanks for looking
Judda

   

- Advertisement -