Full Version: Queries with Date calculation
UtterAccess Discussion Forums > Microsoft® Access > Access Queries
RadioactiveFrog
Hey All,

I am storing a Date that is input in the format: dd/mm/yyyy and also an agreement length as a number of months. I need to pull a query of all agreements due to end within a month...

So I need to write a query that takes the start date and adds months - 1 and see if the current date is bigger...i think..

but I am really not sure how to go about this..

any advice would be appreciated.

Thanks,

graham.
vtd
Do you want to find aggreements that will end in the mext month (as next 28-31 days)?

If yes, try a criterion like:
CODE
... WHERE [AgreementDate] Between DateAdd("m", -[AgreementMonth], Date())
      And DateAdd("m", -[AgreementMonth] + 1, Date())
RadioactiveFrog
Seems to work well! Nice one thanks. sad.gif
vtd
You're welcome ... Glad to help ...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.