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 |
|
klau962
Starting Member
8 Posts |
Posted - 2009-08-05 : 17:14:39
|
| I want to do something along the lines of SELECTMAX(SELECT CASE loccvg.DEDUCTAMT WHEN > 1 THEN loccvg.DEDUCTAMT ELSE loccvg.DEDUCTAMT*loccvg.VALUEAMT END "newDeductible")FROMloccvgWHERE loccvg.DEDUCTAMT > 0But this doesn't work... any ideas?Thanks in advance!:) |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-08-05 : 17:19:44
|
[code]select max(newDeductible) as newDeductible from(SELECT CASE loccvg.DEDUCTAMT WHEN > 1 THEN loccvg.DEDUCTAMT ELSE loccvg.DEDUCTAMT*loccvg.VALUEAMT END "newDeductible"FROM loccvgWHERE loccvg.DEDUCTAMT > 0)dt[/code] No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
klau962
Starting Member
8 Posts |
Posted - 2009-08-05 : 17:45:59
|
| Thanks for this... When I run this I get the message:Incorrect syntax near '>'what does this message mean? |
 |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2009-08-05 : 18:02:17
|
Small typo.. :)quote: Originally posted by webfred
select max(newDeductible) as newDeductible from(SELECT CASE WHEN loccvg.DEDUCTAMT WHEN > 1 THEN loccvg.DEDUCTAMT ELSE loccvg.DEDUCTAMT*loccvg.VALUEAMT END "newDeductible"FROM loccvgWHERE loccvg.DEDUCTAMT > 0)dt No, you're never too old to Yak'n'Roll if you're too young to die.
|
 |
|
|
|
|
|