I am using CR 10, through ODBC from Win XP professional.
Example of my problem:
I have string type time values, here is my <@time> formula:
numberVar secs := Round({DUPTIMRPT4.CPPCTM} mod 100);
numberVar time2 := ({DUPTIMRPT4.CPPCTM}-secs)/100;
numberVar mins := Round(time2 mod 100);
numberVar hours := Round((time2 - mins)/100);
stringVar str := CStr(hours,0,"");
stringVar str1 := CStr(mins,0,"");
stringVar str2 := CStr(secs,0,"");
if ({DUPTIMRPT4.CPPCTM} <> 999999) then
TimeValue(hours, mins,secs );
I have a <@test> formula that counts to 1 for I's and 2's for O's:
if {DUPTIMRPT4.CPTRST} = "I" then
(numberVar countS := 1;
timeVar array timeS0 := [{@TIME}]
)
else if {DUPTIMRPT4.CPTRST} = "O" then
(
timeVar array timeS01 := {@TIME};
countS := countS +1)
else if {DUPTIMRPT4.CPTRST} = "1" then
(countS := 3);
countS;
To display my columns in my desire format, i.e. when <@test> =2, I will display using <@display> formula:
numbervar i := 1;
numbervar j := 1;
if {@TEST} = 2 then ({DUPTIMRPT4.CPTRDN}&" "&{@DATE}&" "&timeVar array timeS0&" "&timeVar array timeS01[j]&" "&{DUPTIMRPT4.CPINHR}&" "&{@RUNTOTAL};
);
Output should look like:
days date timeS0 timeS01
sun 1/2/2005 10:22:34AM 3:45:33PM
sun 1/2/2005 11:23:59AM 3:43:40PM
sun 1/2/2005 09:60:38AM 09:50:38PM
mon 1/3/2005 12:00:32AM 3:33:33PM
mon 1/3/2005 09:30:67AM 09:00:32PM
tues 1/4/2005 5:40:00AM 5:40:00PM
But I get:
days date timeS0 timeS01
sun 1/2/2005 5:40:00AM 5:40:00PM
sun 1/2/2005 5:40:00AM 5:40:00PM
sun 1/2/2005 5:40:00AM 5:40:00PM
mon 1/3/2005 5:40:00AM 5:40:00PM
mon 1/3/2005 5:40:00AM 5:40:00PM
tues 1/4/2005 5:40:00AM 5:40:00PM
But the above formula only takes in the last values for time i.e. timeS0 and timeSO1, i.e. the last two records of time, I want to have all the times just like any other fields, could you please show me some light?
Thanks,
Tanzina