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

How to calculate last day of previous month for formula use 1

Status
Not open for further replies.
Apr 11, 2008
68
GB
I have a report which is run automatically at the end of every month. The report criteria uses the date selection 'monthtodate'.

However, some of the formulae in the report need to use some form of date call that references the last day of the previous month. Currently I have tested the report using an entered parameter 'Start Date' (see below) but to get the report running without intervention, I need to replace the 'Start Date' with some other non intervention term.

i.e. if {cusmast.cm_date_inserted} < {?Start Date} then 0.00
else 1.00

Can anyone help with how I can get the formula above to result in the same output without personal intervention?

Thanks in anticipation.
 
Last day of previous month:

dateserial(year(currentdate),month(currentdate),1)-1

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top