-
Convert Number to Time
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
-
CONVERT(decimal(10,2), (90.0/60)) AS iStart
-
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)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|