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.
Author |
Topic |
cardullo4321
Starting Member
40 Posts |
Posted - 2012-03-01 : 13:59:44
|
Can someone help me convert a string format like 10-FEB-12 into a date like 2/10/2012?Gregory Cardullo |
|
X002548
Not Just a Number
15586 Posts |
|
cardullo4321
Starting Member
40 Posts |
Posted - 2012-03-01 : 14:10:00
|
Thanks. Do you know how to make it more dynamic where it will automatically convert any string to the date format?Gregory Cardullo |
 |
|
cardullo4321
Starting Member
40 Posts |
Posted - 2012-03-01 : 14:22:13
|
convert(varchar(25),convert(datetime,(REPLACE([Buy_Date], '-', ' '))),101 ) as DatedAteGregory Cardullo |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-03-01 : 14:23:58
|
quote: Originally posted by cardullo4321 convert(varchar(25),convert(datetime,(REPLACE([Buy_Date], '-', ' '))),101 ) as DatedAteGregory Cardullo
why are you replacing - characters?why change it to varchar again?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|
|