A
AccessUser29
Guest
hello,
I have a simple database that has a date field to track the time in which a lab test is performed. The date format is as follows:
------------------------------
8/20/2002 12:31:28 PM
-----------------------------
Now to retrive queries by a date range, I am using this query:
---------------------------------------
SELECT CoA.Test_Number, CoA.CoA_Date, CoA.[Product#], CoA.DateCode, CoA.TName, CoA.PH, CoA.Water_Activity, CoA.Moisture, CoA.Peanut_Protein, CoA.Egg_Protein, CoA.Milk_Protein, CoA.Vomitoxin, CoA.Aflatoxin
FROM CoA
WHERE CoA.CoA_Date Between [Start Date] And [End Date];
---------------------------------------
For the most part the query works fine, but it cannot pick up records that are at the final date of the range.
For example,
A range of between 8/15/2002 and 8/20/2002 will miss records that have an 8/20/2002 date & time stamp.
A range of between 8/20/2002 and 8/20/2002 will bring up an empty set even if there are records for that day.
I have a feeling that the problem might lie in the fact that Access is interpreting an inputed parameter of "8/20/2002" as "8/20/2002 12:00:00 AM". Is there a way for my query to ignore the time portion of the field?
thanks
AccessUser29
I have a simple database that has a date field to track the time in which a lab test is performed. The date format is as follows:
------------------------------
8/20/2002 12:31:28 PM
-----------------------------
Now to retrive queries by a date range, I am using this query:
---------------------------------------
SELECT CoA.Test_Number, CoA.CoA_Date, CoA.[Product#], CoA.DateCode, CoA.TName, CoA.PH, CoA.Water_Activity, CoA.Moisture, CoA.Peanut_Protein, CoA.Egg_Protein, CoA.Milk_Protein, CoA.Vomitoxin, CoA.Aflatoxin
FROM CoA
WHERE CoA.CoA_Date Between [Start Date] And [End Date];
---------------------------------------
For the most part the query works fine, but it cannot pick up records that are at the final date of the range.
For example,
A range of between 8/15/2002 and 8/20/2002 will miss records that have an 8/20/2002 date & time stamp.
A range of between 8/20/2002 and 8/20/2002 will bring up an empty set even if there are records for that day.
I have a feeling that the problem might lie in the fact that Access is interpreting an inputed parameter of "8/20/2002" as "8/20/2002 12:00:00 AM". Is there a way for my query to ignore the time portion of the field?
thanks
AccessUser29