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!

Crystal Reports - Quarter4 of previous year

Status
Not open for further replies.

burdej

MIS
Jan 18, 2012
3
GB
Hi

I have a report that runs quarterly and looks for dates in the previous quarter. This is fine for quarters 1 to 3 using the function Calendar1stQtr.

However, now it is January the report has returned no date for Calendar4thQtr as this relates to 2012! I have done a temporary work around to return all data from last year and filtered for October-December 2011, but want it coded correctly ready for January 2013.

Thanks in advance

and
(if month(currentdate) in [1,2,3]
then year({BI0001.CRDATE})= (year(currentdate)-1)
else

if month(currentdate) in [4,5,6] then {BI0001.CRDATTIM} in Calendar1stQtr
else
if month(currentdate) in[7,8,9] then {BI0001.CRDATTIM} in Calendar2ndQtr
else
if month(currentdate) in [10,11,12] then {BI0001.CRDATTIM} in calendar3rdqtr)
 
(if month(currentdate) in [1,2,3]
then {BI0001.CRDATTIM} in date(year(currentdate)-1,10,1) to
date(year(currentdate)-1,12,31) else
if month(currentdate) in [4,5,6] then {BI0001.CRDATTIM} in Calendar1stQtr
else
if month(currentdate) in[7,8,9] then {BI0001.CRDATTIM} in Calendar2ndQtr
else
if month(currentdate) in [10,11,12] then {BI0001.CRDATTIM} in calendar3rdqtr)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top