stuart has attended:
Access VBA course
Filtering a query based on Date and Time
hi
i am trying to filter a query based on date and time
in the query there are a number of fields, tow of them are MCUDate and MCUTime
what i want to do is display information from 02:00:00 yesterday and 02:00:00 today
i know i can apply "between Date() and Date()-1" to filter between dates, but how can i apply a time aswell?
RE: filtering a query based on Date and Time
Hi Stuart,
Thank you for the forum question.
I hope you are well.
You will have to concatenate the dates and time in a new field in your query.
DateAndTime:MCUDate & " " & MCUTime
and the field criteria
Between Date()-1 & #02:00:00# And Date() & #02:00:00#
Kind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector
RE: filtering a query based on Date and Time
Hi Stuart,
Thank you for the forum question.
I hope you are well.
You will have to concatenate the dates and time in a new field in your query.
DateAndTime:MCUDate & " " & MCUTime
and the field criteria
Between Date()-1 & #02:00:00# And Date() & #02:00:00#
Kind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector