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!

Formula for a Time

Status
Not open for further replies.

dbielenda

MIS
Nov 15, 2001
119
US
I have a database field, SAWP030A.TGLMA, which is represented in minutes (let's use 60 minutes for this example). I need to convert that to hours and minutes, so I have used the following formula:

ToText(({SAWP030A.TGLMA})\60, 0) + ':' +
ToText(({SAWP030A.TGLMA}) Mod 60, 0)

The report shows: 1:0 which is correct, but I would like for it to look like 01:00, any suggestions on how to pad this?

Thank you [wink]

 
Dear Dbielenda:

ToText(({SAWP030A.TGLMA})\60, "00") + ':' +
ToText(({SAWP030A.TGLMA})Mod 60, "00")

Notice that the format string is enclosed in quotes.

Hope this helps,

ro Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top