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 |
|
sent_sara
Constraint Violating Yak Guru
377 Posts |
Posted - 2008-03-05 : 02:40:34
|
| can any one help how to convert the 20070701( varchar data type)to 'JUL-07' |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2008-03-05 : 02:48:02
|
| Use the front end you are displaying this in to do the conversion. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-03-05 : 03:21:41
|
| 1 Always use proper DATETIME datatype to store dates2 Let your front end application do the formationMadhivananFailing to plan is Planning to fail |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-03-05 : 03:51:20
|
| [code]declare @a varchar(10)set @a = '20070701'select left(datename(month, @a),3) + '-' + right(cast(year(@a) as varchar(4)),2)[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-03-05 : 03:54:40
|
| Impli(simply)cit convertiondeclare @a varchar(10)set @a = '20070701'select left(datename(month, @a),3) + '-' + right(year(@a),2)MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|