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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-07-06 : 07:43:31
|
| Tim writes "I need to build a stored procedures that takes two fields in a table, checks one for it's value (both fields are numbers/floats) =< 12 If it's less then 12 then use the acutal number. If it's more then 12 use only 12.Field A = 45Field B =< 12 If B <12 then Set B=B, if B is > 12 set B = 12then Sum(a+b) as total.I can't get the syntex right. It seemed simple enough.Thanks for any suggestions." |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-07-06 : 08:04:03
|
Something likeSelect Distinct A+ Case when B <12 then B else 12 end from yourtable MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|