Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: qtrs Post Reply Post New Topic
Author Message
sharona
Senior Member
Senior Member
Avatar

Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
Quote sharona Replybullet Topic: qtrs
     Posted: 24 May 2011 at 9:32am
i am using this formula to create a group
 
if {NYP_pal_care_rpt;1.ADMIT_DATE} in Calendar1stQtr
then 'QTR1' else
if {NYP_pal_care_rpt;1.ADMIT_DATE} in Calendar2ndQtr
then 'QTR2' else
if {NYP_pal_care_rpt;1.ADMIT_DATE} in Calendar3rdQtr
then 'QTR3' else
if {NYP_pal_care_rpt;1.ADMIT_DATE} in Calendar4thQtr
then 'QTR4'
 
if a user selects the previous year i get nothing. how do i account for previous year?
sharona
IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 25 May 2011 at 3:26am
How would the user select the previous year? If you want to add another full set of quarters you can do this

dateadd(yyyy, -1, {1.ADMIN_DATE})

Maybe I am confused about the question though
IP IP Logged
sharona
Senior Member
Senior Member
Avatar

Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
Quote sharona Replybullet Posted: 25 May 2011 at 4:04am
calendar1styr is for the current year you are running the report. if the end user selects the previous year no data displays due to the group.
i wanted to be able to say something like (calendar1styr-1)
so it will pick up any previous year and group it.
i will try your formula, looks like it may work
sharona
IP IP Logged
sharona
Senior Member
Senior Member
Avatar

Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
Quote sharona Replybullet Posted: 26 May 2011 at 6:03am
i used this
DatePart("q", {NYP_pal_care_rpt_summary;1.ADMIT_DATE})
to get my quarter
DatePart('YYYY', {NYP_pal_care_rpt_summary;1.ADMIT_DATE})
to get my year
if {@QTRS}=1 then 'January - March'&'  '&totext({@QTR YEAR},0,'')
else
if {@QTRS}=2 then 'April - June'&'  '&totext({@QTR YEAR},0,'')
else
if {@QTRS}=3 then 'July - September'&'  '&totext({@QTR YEAR},0,'')
else
if {@QTRS}=4 then 'October - December'&'  '&totext({@QTR YEAR},0,'')
to group by qtr. works great!!!!
sharona
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum