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 |
KlausEngel
Yak Posting Veteran
85 Posts |
Posted - 2010-07-19 : 21:29:02
|
I am trying to use CASE syntax to format the output of a numeric value to a string but I am receiving the error message:[Error converting data type varchar to numeric.]My query: SELECT names , CASE WHEN numbers > 5 THEN '5 and more' ELSE numbers ENDFROM MyTableAny help is appreciated |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-07-19 : 21:59:53
|
you have to convert the numbers to stringCASE WHEN numbers > 5 THEN '5 and more' ELSE convert(varchar(10), numbers) END KH[spoiler]Time is always against us[/spoiler] |
 |
|
KlausEngel
Yak Posting Veteran
85 Posts |
Posted - 2010-07-19 : 22:03:31
|
Thank you! |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-07-20 : 03:37:30
|
This is the formation issue that should be done in your front end applicationMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|