Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Incrementing dates

Status
Not open for further replies.

CaptainBob007

Programmer
Dec 20, 2003
42
US
Hi all -

I'm working on a system which issues licenses, most of which have specific lifespans (3 months, 6 months, etc). Right Now I'm having it calculate expiration dates by adding days, however depending on the length of the months, the number of days will obviously vary. Is there a way I can have it set a date exactly 6 months from now, as opposed to 182 days?

~Bob
 
Hi,

[tt]
CalcDate = DateSerial(Year(YourDate), Month(YourDate)+6, Day(YourDate))
[/tt]
:)

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
varexpire=DateAdd("m", 6, now())

I believe this will do it unfortunatly I have no time to test it now. The M stands for month, the 6 for the number of months and now todays date. basically this expression should calculate what 6 months from now is and put that result in the variable varexpire.



Cretin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top