Hi,
I need some help i have end time 7:48 in HH24:MM
start time 6:09 in HH24:MM out put should be 1:39
i was getting Hours1 = 1
Minutes1 = 39 how can i combine two variables in Else statement ?
I tried
numbervar nummins_end_p1 :=ToNumber( Left(trim({TableName.END}),2 )) * 3600+
ToNumber(right(trim({TableName.END}) , 2)) * 60 ;
numbervar nummins_start_p1 := ToNumber( Left(trim({TableName.START}),2 )) * 3600+
ToNumber(right(trim({TableName.START}) , 2)) * 60 ;
numbervar TotalSeconds := ToNumber(nummins_end_p1 - nummins_start_p1 );
numbervar Hours := truncate(TotalSeconds / 3600);
// trim .00 to get hours
numbervar Hours1 := ToNumber(ToText(Hours, 2));
// Subtract the hours portion to get RemainingSeconds
numbervar RemainingSeconds := TotalSeconds - (Hours * 3600);
// Divide RemainingSeconds by 60 to get minutes.
// Use truncate to remove the decimal portion.
numbervar Minutes := truncate(RemainingSeconds/60);
numbervar Minutes1 := ToNumber(ToText(Minutes, 2));
// Subtract the Hours and Minutes and what is left over is seconds.
numbervar Seconds := TotalSeconds - (Hours * 3600) - (Minutes * 60);
// Format the hours, minutes, and seconds to hh:mm:ss
numbervar hoursmin :=ToNumber(totext(Hours,"00")) + ToNumber(totext(Minutes,"00")) ;
If {Tablename.column} = 0 Then
condition
else
ToNumber(Hours1 & ":" & Minutes1);
Ex:- 1:39 I need output like this I tested this formula it is not showing any errors
ToNumber(Hours1 & ":" & Minutes1); but when i run the report it is showing "The String is non numeric".
I tried
If {Tablename.column} = 0 Then
condition
else
Hours1; // it is giving the hours
I tried
If {Tablename.column} = 0 Then
condition
else
Minutes1; // it is showing minutes
When i use this ToNumber(Hours1 & ":" & Minutes1); then i am getting "the String is non Numeric error Message"
Can any one please guide me through this. I really appriciate it
Thanks in advance
Edited by rupa - 06 Jan 2012 at 4:09am