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
 Date Conversion...

Author  Topic 

jjz
Starting Member

31 Posts

Posted - 2010-07-20 : 02:45:58
Hi all

may someone please assist.

I am trying to conver the following field to represent the below results:

From:
Mar 29 2006 12:00AM
Apr 25 2006 12:00AM
Apr 25 2006 12:00AM

To:
2006/03/29
2006/04/25
2006/04/25

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-07-20 : 02:49:02
what is the data type of those field ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

jjz
Starting Member

31 Posts

Posted - 2010-07-20 : 02:52:10
varchar
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-07-20 : 03:13:04
select convert(datetime, datecol, 0)


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-07-20 : 03:25:23
Make sure to read this
http://beyondrelational.com/blogs/madhivanan/archive/2010/06/29/understanding-datetime-column-part-iv.aspx

Madhivanan

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

- Advertisement -