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 |
|
jrockfl
Posting Yak Master
223 Posts |
Posted - 2006-06-08 : 14:29:04
|
| Let's say I haveDECLARE @CostYTD DecimalDECLARE @CostPTD DecimalCan I set both of these variables at the same time?SELECT SUM(CostYTD) As CostYTD, SUM(CostPTD) AS CostPTDFROM TableInstead of doing..SET @CostYTD = (SELECT SUM(CostYTD) As CostYTDFROM Table)SET @CostCostPTD = (SELECT SUM(CostCostPTD) As CostCostPTDFROM Table) |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-06-08 : 14:29:58
|
| SELECT @CostYTD = SUM(CostYTD), @CostPTD = SUM(CostPTD)FROM TableTara Kizeraka tduggan |
 |
|
|
jrockfl
Posting Yak Master
223 Posts |
Posted - 2006-06-08 : 14:32:45
|
| Thanks Tara for the quick reply!I love this web site, I have responses before I even finish posting my question! |
 |
|
|
|
|
|