I have a column in sql that is an INT and I have to convert it to time.
I’ve tried
CONVERT (VARCHAR, columnA / 600000)
+ ':'
+ RIGHT ('00' + CONVERT (VARCHAR, c_columnA % 60), 2)
but that’s not the result. Any idea’s how the data might be being casted?
Here a sample of the data:
INT |TIME 4680001|13:00 4680001|13:00 4596001|12:45 3846001|10:41 4320001|12:00
It’s already in the comments but I’ll post this as an answer:
If you ignore the trailing 1, the value could be hundredths of a second since midnight –
e.g.
select dateadd(ms,384600 * 100,'19000101')gives19000101 10:41or as a query: