Go4Expert

Go4Expert (http://www.go4expert.com/)
-   SQL Server (http://www.go4expert.com/forums/sql-server-forum/)
-   -   Format function in query (http://www.go4expert.com/forums/format-function-query-t18361/)

shukla 5Jul2009 15:09

Format function in query
 
Hi All!
I am new to sql server 2005
I want to use format function in sql query
Format(dtfld,'dd-mmm-yyyy').
How to use it ?:nonod:
Also for numbers, format(no1,"0.00") :crazy:

shabbir 5Jul2009 15:31

Re: Format function in query
 
What is your input format and what you would like the output to be formatted.

shukla 6Jul2009 09:50

Re: Format function in query
 
My database contains dt as "datetime" type.
I want it in format as dd-mmm-yyyy

naimish 6Jul2009 09:52

Re: Format function in query
 
MS SQL Server 2005 provides CONVERT function to change or convert the DateTime formats.



CONVERT Function syntax:

Convert (datatype, datetime string, date style)


All times are GMT +5.5. The time now is 21:33.