software is fun software is fun - 3 months ago 18
SQL Question

How to get data between two dates using a Query in Access 2016

SELECT SignIn.VisitorFirstName, SignIn.VisitorLastName, SignIn.SignInDateTime
FROM SignIn
WHERE (((SignIn.[Complete])=Yes)) AND SignIn.SignInDateTime between #08/08/2016# and #08/10/2016#


The SignInDateTime is a Date/Time in MS Access 2016

The data in the field looks like 8/1/2016 12:30:11 PM

I am trying to find records between dates (not really caring about the time)

Answer

This should work, format the SignInDateTime first then place your criteria on the formatted datetime

SELECT SignIn.VisitorFirstName, SignIn.VisitorLastName, SignIn.SignInDateTime
FROM SignIn
WHERE (((SignIn.Complete)=Yes) AND ((Format([SignInDateTime],"Short Date")) Between #8/8/2016# And #8/10/2016#));