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
 General SQL Server Forums
 New to SQL Server Programming
 Convert Time Stamp to Datetime in sql server 2005
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sachin.hingole
Starting Member

India
15 Posts

Posted - 01/16/2009 :  02:22:48  Show Profile  Click to see sachin.hingole's MSN Messenger address  Send sachin.hingole a Yahoo! Message  Reply with Quote
Hi,

I want to convert the timestamp (I have took this column from the SQL server 2000 and want to convet that timestamp into date for SQL server 2005) column to the datetime is there any function or way to convert it into datetime

I have tried using cast and convert functions but its giving wrong output

Thanks in advance

Sachin Hingole

Edited by - sachin.hingole on 01/16/2009 02:24:48

SwePeso
Patron Saint of Lost Yaks

Sweden
29908 Posts

Posted - 01/16/2009 :  02:28:52  Show Profile  Visit SwePeso's Homepage  Reply with Quote
Do you have any example?



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

sachin.hingole
Starting Member

India
15 Posts

Posted - 01/16/2009 :  02:35:47  Show Profile  Click to see sachin.hingole's MSN Messenger address  Send sachin.hingole a Yahoo! Message  Reply with Quote
the time stamp column has the data as
0x00000000000067FB
select CAST (0x00000000000067FB as datetime )


Sachin Hingole
Go to Top of Page

ashishashish
Constraint Violating Yak Guru

India
408 Posts

Posted - 01/16/2009 :  03:26:00  Show Profile  Send ashishashish a Yahoo! Message  Reply with Quote
Wat Ur Expected Output.....
mean the output for me is when i run this query,,,,


select cast(0x00000000000067FB as datetime)


1900-01-01 00:01:28.730
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
29908 Posts

Posted - 01/16/2009 :  03:32:44  Show Profile  Visit SwePeso's Homepage  Reply with Quote
Timestamp is NOT a datetime value. It is a "row version" number...
SELECT CAST(0x00000000000067FB AS BIGINT)
reveals the number 26619, which roughly means this record has been edited 26619 times.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000