UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Queries with Date calculation    
 
   
RadioactiveFrog
post Jan 29 2008, 05:15 AM
Post #1

UtterAccess Addict
Posts: 195
From: England



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.
Go to the top of the page
 
+
vtd
post Jan 29 2008, 05:42 AM
Post #2

Retired Moderator
Posts: 19,667



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())
Go to the top of the page
 
+
RadioactiveFrog
post Jan 29 2008, 06:05 AM
Post #3

UtterAccess Addict
Posts: 195
From: England



Seems to work well! Nice one thanks. (IMG:http://www.utteraccess.com/forum/style_emoticons/default/sad.gif)
Go to the top of the page
 
+
vtd
post Jan 29 2008, 06:16 AM
Post #4

Retired Moderator
Posts: 19,667



You're welcome ... Glad to help ...
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th May 2013 - 01:51 AM