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!

Finding Last Days of Previous Months

Status
Not open for further replies.

KMendels

MIS
Feb 24, 2012
4
US
I have the formula to find the last day of the previous month - DateSerial(year({@Date This Month Thru}), month({@Date This Month Thru}), 1) -1.

How can I get it to find the last day of 2 months ago, 3 months ago, etc.?
 
2 months ago
DateSerial(Year({@Date This Month Thru}), Month({@Date This Month Thru}) – 1 , 1)-1
3 months ago
DateSerial(Year({@Date This Month Thru}), Month({@Date This Month Thru}) – 2 , 1)-1

N months ago
DateSerial(Year({@Date This Month Thru}), Month({@Date This Month Thru}) – N -1 , 1)-1

Viewer, scheduler and report manager for Crystal reports and SSRS.
Send your report everywhere.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top