
I'm having problems querying access database
Quote:
> I have been trying to query a database in vb4 and I am having
> problems. When I execute this code it comes back with an empty
> dynaset? (there is data in the table with the date in question) I
> have solved the problem before, but for lack of a brain I did not file
> the answer anywhere. Could someone help explain what I'm doing wrong
> and how to fix it?? Please? A troubled newbie!
> CODE:
> Dim intdate As Date
> intdate = #5/7/97#
> Data1.RecordSource = ("SELECT DISTINCTROW Interview.interviewdate,
> Interview.interviewtime, " _
> & "Contacts.Firstname, Contacts.Lastname FROM Contacts INNER JOIN
> Interview ON " _
> & "Contacts.contactid = Interview.contactid Where " _
> & "(Interview.interviewdate =" & CDate(intdate) & "" _
> & ")ORDER BY Interview.interviewtime")
If the field is a Date/Time field, it might have the date but ther might be
a time associated. so 5/7/97 <> 5/7/97 12:01 am. The serial value for
each is different. 5/7/97 is the same as 5/7/97 12:00 am.
Also if 'intdate' is declared as a date var, why are you converting it to a
date
--
JD
** When all else fails, RTFM