| Author |
Topic |
|
slimt_slimt
Aged Yak Warrior
746 Posts |
Posted - 2007-10-22 : 05:03:56
|
| hi,i would like to convert text string(field) to varchar so I can use later group by a special string.what shall i use?thank you |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-10-22 : 05:23:30
|
| look up convert function_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-10-22 : 05:32:40
|
| Make sure text string does not exceed the limit of varchar i.e. 8000 characters.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
slimt_slimt
Aged Yak Warrior
746 Posts |
Posted - 2007-10-22 : 05:56:13
|
| I use this:select convert(varchar(10), note) as new_note, count(new_note) as frequencyfrom table1group by new_notebut i will not perform group by. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-10-22 : 06:34:51
|
quote: Originally posted by slimt_slimt I use this:select convert(varchar(10), note) as new_note, count(new_note) as frequencyfrom table1group by new_notebut i will not perform group by.
Your statement seems unclear. Did you mean this?select convert(varchar(10), note) as new_note, count(convert(varchar(10), note) ) as frequencyfrom table1group by convert(varchar(10), note) MadhivananFailing to plan is Planning to fail |
 |
|
|
shivashankardep
Starting Member
2 Posts |
Posted - 2007-10-22 : 06:42:33
|
| hi useconvert(varchar(10),'text') |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-10-22 : 06:54:17
|
quote: Originally posted by shivashankardep hi useconvert(varchar(10),'text')
Did you read the question fully?MadhivananFailing to plan is Planning to fail |
 |
|
|
slimt_slimt
Aged Yak Warrior
746 Posts |
Posted - 2007-10-22 : 08:28:09
|
| Madhivanan; your code is not working properly..... Did I miss anything? |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-10-22 : 08:33:57
|
quote: Originally posted by slimt_slimt Madhivanan; your code is not working properly..... Did I miss anything?
Post your query here KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|