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 |
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2009-03-24 : 11:54:18
|
| Greetings,When doing following query I might get no results. But I still want to set @CutArea to 0 . But I cannot do a COALESCE here because there are not rows coming back. Is there a simpler way of doing it other than what I plan to do that isdoing a EXISTS (SELECT * from VCutArea....with the bottom WHERE clause) SELECT @CutArea = DefinitionValue FROM dbo.VCutArea AS vca WHERE vca.DefinitionDate = @CapacityPlanningDate AND vca.BranchID = @BranchID AND vca.CommodityID = @CommodityIDThank you very much as always |
|
|
sakets_2000
Master Smack Fu Yak Hacker
1472 Posts |
Posted - 2009-03-24 : 12:00:47
|
| [code]set @CutArea=0 SELECT @CutArea = DefinitionValueFROM dbo.VCutArea AS vcaWHERE vca.DefinitionDate = @CapacityPlanningDateAND vca.BranchID = @BranchIDAND vca.CommodityID = @CommodityID[/code] |
 |
|
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2009-03-24 : 12:07:54
|
| AHA!!!!! Thank you very much Saket Sinha |
 |
|
|
sakets_2000
Master Smack Fu Yak Hacker
1472 Posts |
Posted - 2009-03-24 : 12:20:49
|
| np |
 |
|
|
|
|
|