Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hhmmss conversion problem

Status
Not open for further replies.

mgallot

MIS
Jan 22, 2001
93
US
I am trying to convert to hhmmss from a duration field that contains seconds. I'm using CR 9.0 and SQL Server. I keep getting a message that the 'remaining text does not appear part of the formula'. What am I missing?

whileprintingrecords;
numberVar dur := {GCDR.Duration}
numberVar hrs;
numberVar min;
numberVar sec;
stringVar hhmmss;

hrs := Truncate(Truncate(dur/60)/60);
min := Remainder(Truncate(dur/60),60);
sec := Remainder(dur,60);

hhmmss := totext(hrs,"00") + ":" + totext(min,"00") + ":" + totext(sec,"00");

hhmmss

 
Forgot the semicolon after the {GCDR.Duration}:

whileprintingrecords;
numberVar dur := {GCDR.Duration};
numberVar hrs;
numberVar min;
numberVar sec;
stringVar hhmmss;
hrs := Truncate(Truncate(dur/60)/60);
min := Remainder(Truncate(dur/60),60);
sec := Remainder(dur,60);
hhmmss := totext(hrs,"00") + ":" + totext(min,"00") + ":" + totext(sec,"00");
hhmmss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top