SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Old Forums
 CLOSED - General SQL Server
 Date as Int ...
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

lassew
Starting Member

5 Posts

Posted - 06/03/2005 :  08:41:15  Show Profile
I'm trying to analyse a SQL Server 8 database where date is stored as Int, Null. Is it possible to convert it to a dateformat?

Seventhnight
Flowing Fount of Yak Knowledge

USA
2878 Posts

Posted - 06/03/2005 :  08:42:49  Show Profile  Visit Seventhnight's Homepage
what kind of int?? what does it look like?

Corey

Secret Service Agent: Mr. President, you're urinating on me.
President Lyndon Johnson: I know I am. It's my prerogative.
Go to Top of Page

spirit1
Cybernetic Yak Master

Slovenia
11751 Posts

Posted - 06/03/2005 :  08:43:26  Show Profile  Visit spirit1's Homepage
how is it stored can you give an example?

select covert(datetime, YourDateColumn)
from YourTableAme

Go with the flow & have fun! Else fight the flow
Go to Top of Page

lassew
Starting Member

5 Posts

Posted - 06/03/2005 :  08:47:45  Show Profile
Some exemples of dok_dt

1046440184
1046440184
1046440184
1047027417
1047033499
1047034683
1047034683
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22765 Posts

Posted - 06/03/2005 :  08:51:38  Show Profile  Send madhivanan a Yahoo! Message
What output do you expect from those?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 06/03/2005 :  09:51:04  Show Profile
Good, another date question

Please follow the direction in the link below.



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page

Arnold Fribble
Yak-finder General

United Kingdom
1961 Posts

Posted - 06/03/2005 :  10:21:01  Show Profile
Wild guess: it's seconds from UNIX epoch.

DATEADD(s, dok_dt, '19700101 00:00:00')


Edited by - Arnold Fribble on 06/03/2005 10:22:54
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 06/03/2005 :  10:36:05  Show Profile
Good lord.....not again...

What the hell don't you know?

Gotta blog this as well...


DECLARE @dok_dt int
SELECT @dok_dt = 1047034683
SELECT DATEADD(s, @dok_dt, '19700101 00:00:00')




Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000