Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Timestamp coversion

Author  Topic 

sinapra
Starting Member

24 Posts

Posted - 2007-05-24 : 08:35:15
Hello All

I have a timestamp field in the table that is of Float datatype and an example of one Timestamp is '37281.5103009259'. I am not sure how to convert this to Date format because as far as i know unix timestamp is only 10 digit and has no decimal in between.

I donot have access to script file else would have been able to show you.

Thanks

Cheers

sshelper
Posting Yak Master

216 Posts

Posted - 2007-05-24 : 08:42:55
Try using the CAST function to convert the float into a DATETIME data type:

select cast(37281.5103009259 as datetime)

SQL Server Helper
http://www.sql-server-helper.com
Go to Top of Page

sinapra
Starting Member

24 Posts

Posted - 2007-05-24 : 09:09:32
That helped SSH, you are great........

Cheers
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-05-24 : 09:14:35
moved from script library.

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-05-26 : 03:32:21
quote:
Originally posted by spirit1

moved from script library.

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp


Can you move other threds as well?
There are many questions posted at Script Library

Madhivanan

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

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-05-26 : 06:23:41
quote:
Can you move other threds as well?
There are many questions posted at Script Library

Good idea.


KH

Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-05-26 : 09:02:50
they are all quite old... any particular reason?

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-05-26 : 10:32:24
quote:
Originally posted by spirit1

they are all quite old... any particular reason?

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp


No reason. Just a thought

Madhivanan

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

- Advertisement -