SQL Where Using Date For Attributes With Date & Time

  • Thread starter Thread starter Adam Potter
  • Start date Start date
A

Adam Potter

So I have an attribute in a table which contains a date and time (date / time
something was sent). Then in a SQL query I need to pull out everything
between one date and another. I know about the switching to dd/mm/yyyy in the
SQL query.

I've tried all sorts of ways including adding the time of 00:00:00 to the
start date and 23:59:59 to the end date of the range but no luck.

Can someone tell how you would do this in the SQL Where statement please
that I'm building in my VBA code.
 
So I have an attribute in a table which contains a date and time (date / time
something was sent). Then in a SQL query I need to pull out everything
between one date and another. I know about the switching to dd/mm/yyyy inthe
SQL query.

I've tried all sorts of ways including adding the time of 00:00:00 to the
start date and 23:59:59 to the end date of the range but no luck.

Can someone tell how you would do this in the SQL Where statement please
that I'm building in my VBA code.


SELECT ...
FROM MyTable
WHERE [eventdate]>=#1/1/2009# AND [eventdate]<=Date+1;
 
Back
Top