Date query problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to query a field based on date alone. The data also contains the time
component. When I query as dd/mm/yyy (i.e. #04/19/2000#) I get no results -
if I include time as well it works. I need to query just on date though. I
have tried formatting the query date column with no success. Is there another
way to go about this?

Thanks
 
Add a calculated field to your query:
JustTheDate: DateValue([FieldName])

Then use your criterion on this field.
 
Yep, that did it, TYVM

Ken Snell said:
Add a calculated field to your query:
JustTheDate: DateValue([FieldName])

Then use your criterion on this field.

--

Ken Snell
<MS ACCESS MVP>

CCT said:
I need to query a field based on date alone. The data also contains the
time
component. When I query as dd/mm/yyy (i.e. #04/19/2000#) I get no
results -
if I include time as well it works. I need to query just on date though. I
have tried formatting the query date column with no success. Is there
another
way to go about this?

Thanks
 
Method one: Change the criteria to
=#04/19/2000# AND <#04/20/2000#
If you are using a parameter then use the something like
=[What day?] AND <=DateAdd("d",1,[What day?] )

Method two: Use the dateValue function
Make a calculated column
Field: JustTheDate: DateValue([YourDateField])
Criteria: #04/19/2000#
 
Back
Top