Sunday, March 11, 2012

Cumulative Total

I try to sum a value in the TABLE FOOTER if this record falls into a
particular condition. But the result is zero.
The formular is as follow:
=Sum(IIf(Fields!EQP_LEN.Value = 20 And Fields!EQP_TYPE.Value = "GP",
Fields!CN_WGT.Value, 0))
If I the formular like this:
=Sum(IIf(Fields!EQP_LEN.Value = 20 And Fields!EQP_TYPE.Value = "GP", 1, 0))
It works !!!
What's wrong ?What's the datatype of Fields!CN_WGT.Value? I would assume it is not a
System.Int32, but 0 is a System.Int32.
You might want to try 0.0 instead of 0:
=Sum(IIf(Fields!EQP_LEN.Value = 20 And Fields!EQP_TYPE.Value = "GP",
Fields!CN_WGT.Value, 0.0))
Alternatively:
=Sum(IIf(Fields!EQP_LEN.Value = 20 And Fields!EQP_TYPE.Value = "GP",
CDbl(Fields!CN_WGT.Value), 0.0))
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
news:26102E03-4F38-4F38-872E-633F5E02B78B@.microsoft.com...
> I try to sum a value in the TABLE FOOTER if this record falls into a
> particular condition. But the result is zero.
> The formular is as follow:
> =Sum(IIf(Fields!EQP_LEN.Value = 20 And Fields!EQP_TYPE.Value = "GP",
> Fields!CN_WGT.Value, 0))
> If I the formular like this:
> =Sum(IIf(Fields!EQP_LEN.Value = 20 And Fields!EQP_TYPE.Value = "GP", 1,
0))
> It works !!!
> What's wrong ?|||Thanks, it works now !!!
"Robert Bruckner [MSFT]" wrote:
> What's the datatype of Fields!CN_WGT.Value? I would assume it is not a
> System.Int32, but 0 is a System.Int32.
> You might want to try 0.0 instead of 0:
> =Sum(IIf(Fields!EQP_LEN.Value = 20 And Fields!EQP_TYPE.Value = "GP",
> Fields!CN_WGT.Value, 0.0))
> Alternatively:
> =Sum(IIf(Fields!EQP_LEN.Value = 20 And Fields!EQP_TYPE.Value = "GP",
> CDbl(Fields!CN_WGT.Value), 0.0))
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
> "May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
> news:26102E03-4F38-4F38-872E-633F5E02B78B@.microsoft.com...
> > I try to sum a value in the TABLE FOOTER if this record falls into a
> > particular condition. But the result is zero.
> > The formular is as follow:
> > =Sum(IIf(Fields!EQP_LEN.Value = 20 And Fields!EQP_TYPE.Value = "GP",
> > Fields!CN_WGT.Value, 0))
> >
> > If I the formular like this:
> > =Sum(IIf(Fields!EQP_LEN.Value = 20 And Fields!EQP_TYPE.Value = "GP", 1,
> 0))
> > It works !!!
> >
> > What's wrong ?
>
>

No comments:

Post a Comment