98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Access Training and help » Filtering a query based on Date and Time
Filtering a query based on Date and Time
Resolved · Medium Priority · Version 2016
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
Training information:
See also:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Access tip:Prefixed AutonumberingWhen using Date Type = Autonumber as a primary key, clients may require autonumbering to be prefixed with a letter. |