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 |
michaelb
Yak Posting Veteran
69 Posts |
Posted - 2008-06-30 : 01:07:39
|
Hi,What I'm trying to do is add up a set of values based on a condition.So there might be 10 values in the set. Each value has a corresponding date.I might want to add up the value with a corresponding date between Jan 1st and Jan 31st.So basically I'm after an RS equivalent of the where clause.Is there anything that will do this and how do I use it?Thanks,Michael |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-30 : 02:27:27
|
You need to use aggregate function SUM() to add up your values and give your conditions for filtering under filter tab of dataset instead of where. And if you're asking about adding conditions inside a report expression use IIF(Expression,Truepart,falsepart) |
 |
|
chrpeter
Starting Member
31 Posts |
Posted - 2008-07-02 : 10:37:27
|
Sounds like you want something like this:=SUM(IIf(Fields!Date.Value > 01/01/2008 AND Fields!Date.Value < 01/31/2008,Fields!amount.value,0.0),"TableGrouping1"))The IIF statement checks the date and if it's in the specified date range, add the values for that table grouping(TableGrouping1).This is assuming the data is being presented in some sort of format that uses grouping. If no grouping is used just put "Nothing"(without the quotes).And this also assumes your date is in the mm/dd/yyyy format. |
 |
|
|
|
|