on 04-17-2009 1:27 PM
Hi All,
I am using the timeserial funcation to return a time format for my numbervar.
whileprintingrecords;
global numbervar shifttimert;
timeserial(0,0,shifttimert);
shifttimert = 236616 which should be 65 hours appr. The serial time the formula returns is 17:43:36.
Why is the timeserial function not returning the correct time? Is the number too large?
Thank you in advance.
Antoine,
TimeSerial will return a time based on the 24 hour clock. So 65/24 = 2 days and 17 hours. As it can only output a time and not days it displays the remainder which is 17
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for that Graham. I guess it only worked for me as it was under 24 hours. However, I did manage to solve my problem with the following code:
stringvar minutes;
stringvar seconds;
numberVar M:=(Remainder(Truncate (/(60)),60)); numberVar S:=(Remainder(Truncate (),60));
if(M<10)then
minutes:="0"&totext(M)
else
minutes:=totext(M);
if(S<10)then
seconds:="0"&totext(S)
else
seconds:=totext(S);
CStr(int(Truncate(/(60*60))),"##") & ":" &minutes&":"&seconds;
That returns the hh:mm:ss that I was looking for.
Hi
Would suggest you to refer to the syntax of timeserial() function from Crystal Reports help.
Regards
Sourashree
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.