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
 Convet DATE

Author  Topic 

jhon11
Starting Member

42 Posts

Posted - 2007-11-27 : 14:25:09
hi ,

i have a cloumn DOB in 1981-02-27 00:00:00:000
and i want that column in 02/27/1981 formate...

how to do that

jhocutt
Constraint Violating Yak Guru

385 Posts

Posted - 2007-11-27 : 14:36:40
If your column is a varchar
convert(varchar(10), Cast(Yourcolumn as datetime), 101)

if it is a datetime as it should be convert(varchar(10), Yourcolumn, 101)

"God does not play dice" -- Albert Einstein
"Not only does God play dice, but he sometimes throws them where they cannot be seen."
-- Stephen Hawking
Go to Top of Page

jhon11
Starting Member

42 Posts

Posted - 2007-11-27 : 14:40:45
thx a lot for ur help
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-11-28 : 01:26:24
quote:
Originally posted by jhon11

hi ,

i have a cloumn DOB in 1981-02-27 00:00:00:000
and i want that column in 02/27/1981 formate...

how to do that


Where do you want to show the formatted dates?
If you use front end application, use format function there

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -