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 |
|
evanburen
Posting Yak Master
167 Posts |
Posted - 2007-06-26 : 09:44:59
|
| Hi - My field TDMergerVotePercent is defined as a float field. I want it to return 'NA' when the value is -1 but I'm getting the error message'Error converting data type varchar to float' in my aspx page. Is there where the CAST function can be used? ThanksCASEWHEN TDMergerVotePercent = -1 THEN 'NA'WHEN TDMergerVotePercent IS NULL THEN ''ELSE TDMergerVotePercentEND AS TDMergerVotePercent |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-06-26 : 09:51:31
|
| [code]CASEWHEN TDMergerVotePercent = -1 THEN 'NA'WHEN TDMergerVotePercent IS NULL THEN ''ELSE cast(TDMergerVotePercent as varchar(20))END AS TDMergerVotePercent[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-06-26 : 10:39:37
|
| Note that you cant make any calculation on those valuesMadhivananFailing to plan is Planning to fail |
 |
|
|
pootle_flump
1064 Posts |
Posted - 2007-06-26 : 11:06:32
|
quote: Originally posted by madhivanan Note that you cant make any calculation on those valuesMadhivananFailing to plan is Planning to fail
No "do it front end"? You are losing your touch. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-06-27 : 04:23:10
|
quote: Originally posted by pootle_flump
quote: Originally posted by madhivanan Note that you cant make any calculation on those valuesMadhivananFailing to plan is Planning to fail
No "do it front end"? You are losing your touch.
Yes. Sometimes I give chance to others MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|