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 |
|
arkiboys
Master Smack Fu Yak Hacker
1433 Posts |
Posted - 2007-11-16 : 05:51:32
|
| Does the case statement look ok to you? It seems only the first when clause inside the case works and not the second one. Notice they are both doing the > 1selectBid_Size = case when len(Bid_Size) > 1 then replace(Bid_Size, 'A', '') when len(Bid_Size) > 1 then replace(Bid_Size, 'E', '') end, Ask_PricefromtblData |
|
|
hitman
Starting Member
23 Posts |
Posted - 2007-11-16 : 06:04:25
|
| well, you can nest 2 replacesreplace(replace(Bid_Size, 'A', ''), 'E', '')-----------------------http://www.sqltips.info----------------------- |
 |
|
|
georgev
Posting Yak Master
122 Posts |
Posted - 2007-11-16 : 07:42:59
|
What do you want to do when Len(Bid_Size) <= 1?[CODE]SELECT CASE WHEN Len(Bid_Size) > 1 THEN Replace(Replace(Bid_Size, 'A', ''), 'E', '') ELSE 'else value' END As [Bid_Size] , Ask_PriceFROM tblData[/CODE]What are you actually trying to achieve here? George<3Engaged! |
 |
|
|
arkiboys
Master Smack Fu Yak Hacker
1433 Posts |
Posted - 2007-11-16 : 08:04:44
|
| Solved. thanks |
 |
|
|
|
|
|
|
|