tags:

views:

50

answers:

2

How do I get the Date 5 Months from Now in access

+3  A: 

Access has a DateAdd function:

DateAdd ("m", 5, Now())
Andomar
There is no reason to use Now() if you're operating on dates only. Use Date() in all cases unless you actually need the time component returned by Now(). Given that running DateAdd ("m", 5, Now()) will not return the same result if you run it five minutes from now, but DateAdd ("m", 5, Date()) *will* give you the same result (unless midnight passed in between the two calls), I can't see any justification for using Now() in this context.
David-W-Fenton
A: 

Take Andomar's answer, but here is a dumber solution:

Future: Date()+((365/12)*5)

The result is somewhat different, and I post it only in case the result is somehow closer to what you need.

Smandoli
@Smandoli Just curious ... if you're going that route, why not (365.25 / 12)?
HansUp
Either ignorance or carelessness ... darn it, I think it's carelessness. Thanks for the tip.
Smandoli
OK. Seems like maybe you're interested in not just the date, but also time of day. If so, consider Now()+((365.25/12)*5)
HansUp
What a terrible suggestion. Its results don't correspond to the calendar or to any human definition of "5 months".
David-W-Fenton