G
Guest
"I hope you can help (at least with the Access part of this question)
I have written a software app in which I have a vb6 frontend to an Access
2002 database. The program creates a recordset based on a query that uses a
time field. In Access, the field is define as a "Date/Time" with format of
"Long Date". When it runs it doesn't find the record (which I know exists).
Even if I create a query in Acess in which one of the fields is time, when I
enter a time (e.g. 8:10:00) in the Criteria line and move to the next field,
Access converts that to #08:10:00 AM#". Now when I run the query, it doesn't
find the record and if I look at the SQL statement the query editor creates
it looks like:
SELECT [Data].[Medical Record #], [Data].Date, [Data].Time, [Data].Site
FROM [Data]
WHERE ((([Data].Time)=#12/30/1899 8:10:0#));
The time field is user inputed so it is not a matter of Access not finding
the exact time to the hundredths sec.
Even if I then change the SQL statement manually at this time to
WHERE ((([Data].Time)=#8:10:00 AM#));
it still doesn't find the record. I am confused...Is there a way to create a
query in Access that will work with a time field.
Thanks for any help.
I have written a software app in which I have a vb6 frontend to an Access
2002 database. The program creates a recordset based on a query that uses a
time field. In Access, the field is define as a "Date/Time" with format of
"Long Date". When it runs it doesn't find the record (which I know exists).
Even if I create a query in Acess in which one of the fields is time, when I
enter a time (e.g. 8:10:00) in the Criteria line and move to the next field,
Access converts that to #08:10:00 AM#". Now when I run the query, it doesn't
find the record and if I look at the SQL statement the query editor creates
it looks like:
SELECT [Data].[Medical Record #], [Data].Date, [Data].Time, [Data].Site
FROM [Data]
WHERE ((([Data].Time)=#12/30/1899 8:10:0#));
The time field is user inputed so it is not a matter of Access not finding
the exact time to the hundredths sec.
Even if I then change the SQL statement manually at this time to
WHERE ((([Data].Time)=#8:10:00 AM#));
it still doesn't find the record. I am confused...Is there a way to create a
query in Access that will work with a time field.
Thanks for any help.