# Miscellaneous > Structured Query Language (SQL) >  Convert Number to Time

## barlowr70

In my database times are stored as integers. Therefore if someone arrives a 1am the value is 60, 2am 120 etc. Is there a way to convert these integer values to 1:00, 2:00. I've tried converting to a decimal so if somene arrives at 1:30 it returns 1.5, but I still only get the integer value...

CONVERT(decimal(10,2), (90/60)) AS iStart

Thanks in advance
Roy

----------


## rmiao

CONVERT(decimal(10,2), (90.0/60)) AS iStart

----------


## nosepicker

You can convert directly to datetime format like this:

SELECT CONVERT(varchar, DATEADD(second, 60, 0), 108)
SELECT CONVERT(varchar, DATEADD(second, 120, 0), 108)

----------

