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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with date formula!

Status
Not open for further replies.

pritiw

Programmer
Mar 2, 2001
14
US
Hi,
I have a numeric parameter which basically stands for "Number of months".
Now i want Crystal to select records(based on date filed in table) which has values within last x months.
That is if user enters '6' as parameter i want it to bring back records in last 6 months.
Someone please help. And i can't use DateAdd function since i am still using older Crystal version.
Thanks
 
what about

month({Datefield}) >= (month(today) - {?param}) and
(if month(today) < {?Param} then
year({datefield}) = year(today) - 1
else
year({datefield}) = year(today))

this seems to work
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top