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
 Need Datetime Format

Author  Topic 

yaman
Posting Yak Master

213 Posts

Posted - 2012-02-10 : 12:54:15
Hello Sir ,

I need to datetime in this format like

" 2012-02-10 14:50:04.430 "

Please help me out .

Yaman

yaman
Posting Yak Master

213 Posts

Posted - 2012-02-10 : 13:01:29
quote:
Originally posted by yaman

Hello Sir ,

I need to datetime in this format like

" 2012-02-10 14:50:04.430 "

Please help me out Sir.

Yaman



Yaman
Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2012-02-10 : 13:41:14
Your presentation layer should handle formatting. But, in the interest of education, you can use the CONVERT function with the ODBC Canonical Style:
SELECT CONVERT(VARCHAR(30), CURRENT_TIMESTAMP, 121)
Go to Top of Page
   

- Advertisement -