cabrera01
Technical User
- Nov 24, 2008
- 15
I have a report that I wrote in crystal 10 in which I'm trying to sum of a field that is using the previous formula. I need to be able to calculate the number of days it took for a patient to be re-admitted a hospital. Each patient is grouped by their account number.
I have a current discharge date formula as:
(@testadm):
whileprintingrecords;
datevar testdisch:={@admitn}
the previous discharge date formula is:
(@prevdisch):
whileprintingrecords;
datevar prevdisch:=PREVIOUS({@dischn})
(@admitn) = cdate(totext({BADPLPP.LPADT1},"00")+"/"+
totext({BADPLPP.LPADT2},"00")+"/"+
totext(2000+{BADPLPP.LPADT3},"0000"))
(@dischn) = cdate(totext({BSYRRVU.RVLDD1},"00")+"/"+
totext({BSYRRVU.RVLDD2},"00")+"/"+
totext(2000+{BSYRRVU.RVLDD3},"0000"))
I can get the number of days between days by using the formula (@redays):
if {@testADM}-{@prevDISCH}<0 then 0 else {@testADM}-{@prevDISCH}
The problem I have is if I'm trying to sum the totals.
Do you have any suggestions what I can do to resolve this summation problem.
Thank you
I have a current discharge date formula as:
(@testadm):
whileprintingrecords;
datevar testdisch:={@admitn}
the previous discharge date formula is:
(@prevdisch):
whileprintingrecords;
datevar prevdisch:=PREVIOUS({@dischn})
(@admitn) = cdate(totext({BADPLPP.LPADT1},"00")+"/"+
totext({BADPLPP.LPADT2},"00")+"/"+
totext(2000+{BADPLPP.LPADT3},"0000"))
(@dischn) = cdate(totext({BSYRRVU.RVLDD1},"00")+"/"+
totext({BSYRRVU.RVLDD2},"00")+"/"+
totext(2000+{BSYRRVU.RVLDD3},"0000"))
I can get the number of days between days by using the formula (@redays):
if {@testADM}-{@prevDISCH}<0 then 0 else {@testADM}-{@prevDISCH}
The problem I have is if I'm trying to sum the totals.
Do you have any suggestions what I can do to resolve this summation problem.
Thank you