ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how do I convert an integer to hh:mm (part II) (https://www.excelbanter.com/excel-programming/366905-how-do-i-convert-integer-hh-mm-part-ii.html)

kdell

how do I convert an integer to hh:mm (part II)
 
Need to convert a simple integer (no decimals) to HH:MM format. The SQL
statement to convert this is as follows.... €śselect
datediff(mi,cast(cast(250/100 as int) as varchar) + ':' + cast(cast( 250 %
100 * .6 as int) as varchar)€ť

Tried: =TIMEVALUE(TRUNC(250/100)&":"&MOD(250,100)*0.6)
but it returned a decimal value.

Any other suggestions?


Dave Peterson

how do I convert an integer to hh:mm (part II)
 
Format it as time.

Format|cells|Number tab

kdell wrote:

Need to convert a simple integer (no decimals) to HH:MM format. The SQL
statement to convert this is as follows.... €śselect
datediff(mi,cast(cast(250/100 as int) as varchar) + ':' + cast(cast( 250 %
100 * .6 as int) as varchar)€ť

Tried: =TIMEVALUE(TRUNC(250/100)&":"&MOD(250,100)*0.6)
but it returned a decimal value.

Any other suggestions?


--

Dave Peterson


All times are GMT +1. The time now is 02:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com