monoman
Master baiter - I fish!
- Joined
- Mar 23, 2004
- Messages
- 967
Hi,
I have a visual basic 6 program that reads an access table. I need to select records by date. I thought this would be simple, but it seems not.
I'm using DAO, erm...i've no idea what that means so i'll leave that there so i don't embarrass myself further.
Here's my vb code to read the table -
The format of the date in the access table is dd.mm.yyyy. I change the format in the code above because, as far as I can tell, it needs to be in mm/dd/yy format to work with SQL.
(1) Is this right? Does it really have to be in that format?
(2) It doesn't work anyway, no records are found.
Any help would be much appreciated. Cheers.
I have a visual basic 6 program that reads an access table. I need to select records by date. I thought this would be simple, but it seems not.
I'm using DAO, erm...i've no idea what that means so i'll leave that there so i don't embarrass myself further.
Here's my vb code to read the table -
Code:
Qry = "SELECT * FROM OrderHeader WHERE [UserEntered] = " & Staff & _
" AND FORMAT(DateEntered,'MM/DD/YY') = #" & Format(WorkDate, "MM/DD/YY") & "# ORDER BY TimeEntered"
(1) Is this right? Does it really have to be in that format?
(2) It doesn't work anyway, no records are found.
Any help would be much appreciated. Cheers.