all groups > sql server (alternate) > march 2006 >
You're in the

sql server (alternate)

group:

convert a datatype



convert a datatype surya
3/14/2006 5:52:59 AM
sql server (alternate): i have table tt.
it contains two fields one is ttno int,doj datetime . i want to
convert to datetime to varchar .
how it is .... give me some examples
Re: convert a datatype Jens
3/14/2006 6:07:44 AM
No problem, look at the CONVERT function for a specific format you want
to extract. I prefer using the ISO one, though its good for ordering
and international.

CONVERT(VARCHAR(10),GETDATE(),112)

HTH, jens Suessmeyer.

---
http://www.sqlserver2005.de
---
Re: convert a datatype Anith Sen
3/14/2006 8:08:34 AM
Check the topic CONVERT in SQL Server Books Online.

--
Anith

Re: convert a datatype Erland Sommarskog
3/14/2006 10:58:54 PM
Anith Sen (anith@bizdatasolutions.com) writes:
[quoted text, click to view]

Actually, the topic is CAST and CONVERT, lest someone looks in the wrong
place and don't find it.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
AddThis Social Bookmark Button