Query for Date

  • Thread starter Thread starter Markus
  • Start date Start date
M

Markus

I have a table that is linked from another DB and I need
to run a query that returns all the records from a
specific date. The problem is that the data in the table
is listed with the date and the time an incident occured
and the form control that I use as the reference for the
criteria in the query will just have the date information
without time. I could use Between "The Date I want"
And "The Next Day" but this is confusing to other users.
How can I get all records regardless of time to return
from my query even though i only have date information to
run the query?

Thanks
Markus
 
PARAMETERS [Forms]![MyForm]![DateIWant] DateTime;
SELECT *
FROM MyTable
WHERE IncidentDate >= [Forms]![MyForm]![DateIWant]
AND IndidentDate < ([Forms]![MyForm]![DateIWant] + 1)

--
John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
 
Back
Top