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 2000 Forums
 Transact-SQL (2000)
 Formating the Date field

Author  Topic 

saidev
Posting Yak Master

101 Posts

Posted - 2006-06-02 : 18:56:40
Hi Guys,

one of the date field in my table has mm/dd/yyyy HH:mm:ss format. i want only mm/dd/yy format.
how to format this in sql. appreciate your help

THanks

nosepicker
Constraint Violating Yak Guru

366 Posts

Posted - 2006-06-02 : 20:19:49
CONVERT(varchar, yourdatefield, 1)
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-06-02 : 21:59:09
"one of the date field in my table has mm/dd/yyyy HH:mm:ss format"
Do you mean you are using varchar to store date & time ?
date & time value store in datetime or smalldatetime data type is in SQL Server internal format not in any other format. Use convert() to conver to your required format. Refer to Books OnLine on convert for more information


KH

Go to Top of Page
   

- Advertisement -