De-Increment Month Value by 1

  • Thread starter Thread starter Attila Fust
  • Start date Start date
A

Attila Fust

I have a query that returns dates. All of the dates are
the 15th of the month. I need to query so it will de-
increment the month by 1 month. For example, if the date
is 07/15/04 it need the query to return 06/15/04. I can
subtract 30 from the actual date but it won't always
return the 15th of the previous month.

There is a way to do this in Excel but I would like to do
it in Access. Is this easily done?

Attila Fust
 
Yes, using the DateDiff function. With DateDiff you can specify the
interval you want to subtract and month is one of those. Open a VB module
and look in Help for more specifics. Note: the Help in a VB module is
better and more specific to Access than the Help in the Access GUI..

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
Thanks for your help. I actually used the DateAdd
function:

DateAdd ("M", -1, <date>) and it worked fine.

Attila
 
Back
Top