Date Question

hyp527

Registered User.
Local time
Yesterday, 16:57
Joined
Jan 17, 2009
Messages
27
what is >=date()-180?

if I want to write 1 year back from today's date of run or 6 months, what's the best way to write this? i don't want to keep rewriting this everytime I do a run that has a date range for a sales column.

thanks.
 
The BEST way, in my opinion, is to use the DateAdd function.

So, >=date()-180 means greater than, or equal to, 180 days in the past.

If you want 180 days, then I would go

>=DateAdd("d", -180, Date())

But if you want 6 months

>=DateAdd("m", -6, Date())
 
it does exactly what i want to do. thanks bob!
 

Users who are viewing this thread

Back
Top Bottom