I have the following data on a table
tbl Admission : Date and Time are two different fields and stored in dd/mm/yyyy format
AdmitDate AdmitTime
1/6/2012 00:00
3/6/2012 10:00
3/6/2012 19:00
4/6/2012 20:38
5/6/2012 21:00
7/6/2012 03:00
I would like to write a query to show all records between 3/6/2012 07:00:00 and 5/6/2012 06:59:59.
The query should also have the option of having ‘date’ input from user (only the date & time can be the fixed interval between 7 am first day to 6 59 am the second day) – for instance using PARAMETERS.
I use access 2003.
I tried several queries but am not able to perfect one – i do not get accurate results.
Somebody please help.
Thanks,
Regards,
If there was only one
DATETIMEcolumn, the condition for the query would be easy to be constructed:Since you can’t do that and because Access has its own Date and Time functions, I think this will work:
The
DateValue()calls are there to ensure that any time parts in the values passed by the user or in theAdmitDatecolumn are chopped off and only the'07:00'and theAdmitTimeare used.