Page 1 of 1

Minute to HH:MM conversion

Posted: Mon Jul 12, 2010 5:46 am
by Kwan
I use version 2007.2 and used this code to convert minutes stored as integer to HH:MM

,(Select convert(varchar(5), crmActivity.NetTime/60)+':'+convert(varchar(2), crmActivity.NetTime%60)) AS DisplayTime

But if the value does not have minutes left (e.g., NetTime = 60), I get a value of 1:0. How do I get it show as 1:00?

Minute to HH:MM conversion

Posted: Mon Jul 12, 2010 6:57 am
by Jan
Hello,

You can use following expression:

Code: Select all

{Today.ToString("HH:mm")}
Thank you.