![]() |
€uromeinke, FEJ. and Ghoulish Delight RULE!!! NA abides. |
![]() |
#1 |
8/30/14 - Disneyland -10k or Bust.
|
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?
__________________
- Taking it one step at a time.
|
![]() |
Submit to Quotes
![]() |
![]() |
#2 |
Not Tref
|
I would love to help you, but, hell, I wish I could get back to 11:16 am! Those were so some good times.
__________________
Tref3.0 Listen in aural 3-D to Pop's muzak! (New songs added semi-bi-daily) ![]() j & j Did you know that Emas eht yltcaxe is exactly the same spelled backwards?! |
![]() |
Submit to Quotes
![]() |
![]() |
#3 |
SQUIRREL!
Join Date: Jan 2005
Location: On the curbside.
Posts: 5,098
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
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. ![]() |
![]() |
Submit to Quotes
![]() |
![]() |
#4 |
check your head
Join Date: Oct 2005
Posts: 4,174
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Id be most curious as to why such a thing would be done to begin with. Is this a table you built?
__________________
![]() a clear conscience is a sure sign of a fuzzy memory ![]() |
![]() |
Submit to Quotes
![]() |
![]() |
#5 |
Prepping...
Join Date: Jan 2005
Location: Here, there, everywhere
Posts: 11,405
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
select * from dbo.coworkers
where coworkers = 'helpful' 2 results returned. |
![]() |
Submit to Quotes
![]() |
![]() |
#6 |
8/30/14 - Disneyland -10k or Bust.
|
Oh hell no! It's a commercial product from a company that ought to know better.
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.
__________________
- Taking it one step at a time.
|
![]() |
Submit to Quotes
![]() |
![]() |
#7 |
ohhhh baby
|
My husband must be in meetings all day.
__________________
The second star to the right shines in the night for you |
![]() |
Submit to Quotes
![]() |
![]() |
#8 |
I Floop the Pig
|
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.
__________________
'He who receives an idea from me, receives instruction himself without lessening mine; as he who lights his taper at mine, receives light without darkening me.' -TJ |
![]() |
Submit to Quotes
![]() |
![]() |
#9 |
Chowder Head
Join Date: Jan 2005
Location: Yes
Posts: 18,500
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Yes, I am sure that there are a lot of them.
__________________
The thing about quotes on the internet is that you cannot verify their validity.
- Abraham Lincoln |
![]() |
Submit to Quotes
![]() |
![]() |
#10 |
.
Join Date: Feb 2005
Posts: 13,354
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Same here. Started to respond with math and said "no, that can't be the problem."
|
![]() |
Submit to Quotes
![]() |