I'm Using Crystal Reports XI with SQL Server.
My report requires one date parameter the "Survey Date". The goal of the report is to report the number of deficiencies in quarters for the previous 12 full months from the Survey Date. I can't display the correct quarter dates.
I need to display dates like the example below if the user enters a survey date of '2008-03-11':
Delinquency Reporting Period of 03/01/2007 to 2/29/2008
Quarter 1 Quarter 2 quarter 3 quarter 4
3/1/07-5/31/07 6/1/07-8/31/07 9/1/07-11/30/07 12/1/07-2/29/08
Formulas I'm using to display the Delinquency Reporting Period:
Report Start Date: date(DateAdd ("d", 1, DateAdd("yyyy", -1, {@Report End Date})))
Report End Date:
If Month(DateAdd("d", 1, {?Survey Date})) <> Month({?Survey Date}) Then
formula = {?Survey Date}
Else
formula = DateSerial(Year({?Survey Date}), Month({?Survey Date}), 1 - 1)
End If
I've tried this for Quarter 1, but I get the wrong end date, I return 6/1/2007 instead of 5/31/2007.
date(DateAdd ("d", 1, DateAdd("yyyy", -1, {@Report End Date})))
& " - " &
Date(DateAdd ('q',1,DateSerial(Year({@Report End Date}) - 1, Month({@Report End Date}), Day({@Report End Date})) ))
Any help would greatly be appreciated, thank you in advance.
My report requires one date parameter the "Survey Date". The goal of the report is to report the number of deficiencies in quarters for the previous 12 full months from the Survey Date. I can't display the correct quarter dates.
I need to display dates like the example below if the user enters a survey date of '2008-03-11':
Delinquency Reporting Period of 03/01/2007 to 2/29/2008
Quarter 1 Quarter 2 quarter 3 quarter 4
3/1/07-5/31/07 6/1/07-8/31/07 9/1/07-11/30/07 12/1/07-2/29/08
Formulas I'm using to display the Delinquency Reporting Period:
Report Start Date: date(DateAdd ("d", 1, DateAdd("yyyy", -1, {@Report End Date})))
Report End Date:
If Month(DateAdd("d", 1, {?Survey Date})) <> Month({?Survey Date}) Then
formula = {?Survey Date}
Else
formula = DateSerial(Year({?Survey Date}), Month({?Survey Date}), 1 - 1)
End If
I've tried this for Quarter 1, but I get the wrong end date, I return 6/1/2007 instead of 5/31/2007.
date(DateAdd ("d", 1, DateAdd("yyyy", -1, {@Report End Date})))
& " - " &
Date(DateAdd ('q',1,DateSerial(Year({@Report End Date}) - 1, Month({@Report End Date}), Day({@Report End Date})) ))
Any help would greatly be appreciated, thank you in advance.