![]() |
Any SQL Guru's out there?
I'm spacing on this one....
I have a SQL table with the time stored as the number of milliseconds since midnight (I think). How do I get from 5,677,528 back to 11:16am? |
Quote:
|
Well, let me pry open a box that's been stored in the back of my brain for 4 years. I recall it being a very simple code fix...
I think it's something like dbo.FormatDateTime('SHORTDATE') Lemme know if that sets you on the right track, and if not, I'll open one of my old tables. :) |
Quote:
|
select * from dbo.coworkers
where coworkers = 'helpful' 2 results returned. |
Quote:
I found what I needed. After checking my math I figured out the values where 100's of a second not milliseconds. However SQL does not seem to have a centisecond option so I ended up converting to milliseconds anyways. rtrim(substring(Convert(varchar,dateadd(ms,time*10 ,'2010-10-2'),13),13,5)) did the trick. |
My husband must be in meetings all day.
|
I could have done the math, but still don't have enough stick time with sql to have the syntax down without a lot of reference/trial and error. And I knew Moonie could do the math, so the syntax was the important part.
|
Quote:
|
Quote:
|
All times are GMT -7. The time now is 04:46 AM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.