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 |
|
syoselevsky
Starting Member
7 Posts |
Posted - 2006-05-19 : 17:18:07
|
| I am trying to add several components of a contest where the values are stored in one table together.This is what I have:sum(case when week = @week then (pt1+weekpt1ext+weekpt2+weekpt2bonus) else 0 end) as totweek,it renders me with a zero value in the table I'm appending the totals to.Help!Stacy |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-05-19 : 17:28:27
|
| difficult to say without a bit more info.What's in week and @week?probably need some example data and the query you are running==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-05-20 : 01:58:55
|
| Did any of the column value have NULL value?Post some sample data and the result you wantMadhivananFailing to plan is Planning to fail |
 |
|
|
syoselevsky
Starting Member
7 Posts |
Posted - 2006-05-23 : 12:46:39
|
| Thanks for the brain pick! I changed the nulls to zeros and it worked... THANKS!! |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-05-24 : 03:09:14
|
| You can use Isnull(col,0)MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|