accessing data in SQL by date problem

Paulw88

New member
Joined
Apr 5, 2006
Messages
4
Programming Experience
Beginner
VS/VB2005 - SQL2000

I am using the following to try getting data from a SQL db:
SQLCommandH = "select * from DeliveryTransH where userid = " & "'" & auserin & " '" & _
" and idate = " & Today ' & " and department = " & "'" & adeptin & "'"

It is not returning any records. The value in Today is shown as #4/14/06#. The SQL db field is defined as datetime and shows as 4/14/06 in Ent. Mgr.

If I remove the date criteria from the command it works; if I change the date comparison operator to >= then it returns all records for the user id entered regardless of date.

There is something I don't understand about working with dates and I would appreciate any help. TIA
 
Back
Top