Using CR XI
My data looks as below
GH -4242 (tblPerson.PersonID)
Case ID Date Received Date Completed
D-1111 01 Feb 07 31 May 07
D-1112 03 June 07 01 Aug 07
D-1113 09 Sept 07 02 Feb 08
Data is grouped by personID. A person could be on more than one case. I am trying to find the date difference between the first date in year 2007-2008(Year starts at 1stApril and ends at 31st March).
In the above case it will be 03 June 07. I can’t use the straight forward Minimum() function as it will give me 01 Feb 07 which is outside Apr 07-March08.
To achieve this I created a shared variable called flag. I am resetting flag in report header.
@ResetFlag
Shared NumberVar Flag;
Flag:=0
I have created a formula called @MinDate to find out the minimum date in year 2007-08.
@MinDate
Shared DateTimeVar MinDt;
shared NumberVar Flag;
if {tblCase.DateReceived} >= DateTime (2007, 04, 01, 00, 00, 00) and Flag = 0 then
MinDt:= {tblCase.DateReceived};
flag:=flag+1;
The above formula returns 09 Sept 07 from the above example which is the wrong date. Please could you spread some light on what I am doing wrong. ?
Many thanks
C8
My data looks as below
GH -4242 (tblPerson.PersonID)
Case ID Date Received Date Completed
D-1111 01 Feb 07 31 May 07
D-1112 03 June 07 01 Aug 07
D-1113 09 Sept 07 02 Feb 08
Data is grouped by personID. A person could be on more than one case. I am trying to find the date difference between the first date in year 2007-2008(Year starts at 1stApril and ends at 31st March).
In the above case it will be 03 June 07. I can’t use the straight forward Minimum() function as it will give me 01 Feb 07 which is outside Apr 07-March08.
To achieve this I created a shared variable called flag. I am resetting flag in report header.
@ResetFlag
Shared NumberVar Flag;
Flag:=0
I have created a formula called @MinDate to find out the minimum date in year 2007-08.
@MinDate
Shared DateTimeVar MinDt;
shared NumberVar Flag;
if {tblCase.DateReceived} >= DateTime (2007, 04, 01, 00, 00, 00) and Flag = 0 then
MinDt:= {tblCase.DateReceived};
flag:=flag+1;
The above formula returns 09 Sept 07 from the above example which is the wrong date. Please could you spread some light on what I am doing wrong. ?
Many thanks
C8