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
 General SQL Server Forums
 New to SQL Server Programming
 Date & Time Format Change

Author  Topic 

perpatimenos
Starting Member

2 Posts

Posted - 2011-04-27 : 07:55:46
In a system table where i have the data there is one last column which keep the time that data has change. The format of the date and time is: 40582.5856828704

I want to create a view that to collect info from different columns.
How can i change the value of date & time in order to be able to view as: 18-04-11 13:09

Thanks in advance for your valuable time.

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-04-27 : 08:00:39
Try select convert(smalldatetime,40582.5856828704)

although give 02/18, not 04/18

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-04-27 : 08:37:14
??

It gives
2011-02-10 14:03:00


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-04-27 : 09:38:08
Uh oh, the hallucinations are back!

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

perpatimenos
Starting Member

2 Posts

Posted - 2011-04-27 : 10:09:46
It works for me.
Thank you very much.
Go to Top of Page
   

- Advertisement -