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

create previous month to date

Status
Not open for further replies.

pl1101

Programmer
Dec 5, 2009
46
0
0
Hello, I am trying to create totals comparing month to date and previous month to date. I created start previous date by using minimum(Lastfullmonth), but I can not figure out how to find the previous month to date. For example if today is 10/21/2013 how do I find 09/21/2013?

Can someone help, please? I am using Crystal reports 2008, with oracle backend.
 
The following 2 pieces of code will return the dates representing the start/finish of the last month to date.

[Code Previous_Month_Start]
DateSerial(Year(CurrentDate), Month(CurrentDate)-1, 1)
[/Code]

[Code Previous_Month_End]
DateSerial(Year(CurrentDate), Month(CurrentDate)-1, Day(CurrentDate))
[/Code]

Hope this helps

Cheers
Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top