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 |
|
phanicrn
Starting Member
42 Posts |
Posted - 2007-11-09 : 11:50:28
|
| Hi I have column as month and value as January, february. etcc....can we convert this character column into date&time format.. if we do that what will be output.. I am doing test instance, when i sort by month column it's sorted in alphabetical order. when we convert this into date&time, it's sorts by date&time, it puts me right direction..i dont know can we do this or not..thanks phani |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-11-09 : 12:23:28
|
| look up the convert function:select convert(datetime, '17 february 2007')_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-11-12 : 02:33:56
|
| select .......order by cast(month_value+' 2007' as datetime)MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|