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 2008 Forums
 Transact-SQL (2008)
 Datetime to varchar

Author  Topic 

Pete_N
Posting Yak Master

181 Posts

Posted - 2012-02-09 : 16:34:15
i need to convert a smalldatetime field to a varchar and return

dd/mm/yyyy

X002548
Not Just a Number

15586 Posts

Posted - 2012-02-09 : 17:04:26
SELECT (varchar(10),dteCol,110)

Look up cast and convert in books online



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-02-09 : 17:39:40
where are you trying to show the dates?
why cant you do formatting at front end? whats the need to convert to varchar for that in sql?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -