October 24, 2011 at 10:57 am
why does this sum the totals in one filed if i choose "LA" and "OK" customers
=IIF(TRIM(First(Fields!SUTASTAT.Value, "DataSet4")) = "OK", sum(Fields!FDWGPYRN.Value, "DataSet4"),CDbl(0))
October 24, 2011 at 12:57 pm
It is hard to say without more details but my guess is because you are using First and the first record has a value of OK
October 24, 2011 at 1:38 pm
That sounds right, what i had to do is a another dataset that gives me only the 1st one. Is there a way to right it where i don't have to put the first there.
October 24, 2011 at 2:26 pm
Here are some details
create table employee(
EMP nvarchar (10),
STATE nvarchar (2),
PAYCODE nvarchar (10),
FDWGPYRN numeric(19, 5)
)
insert into employee (EMP, STATE, PAYCODE, FDWGPYRN)
values ('A', 'OK', 'DISAB', 411.51)
insert into employee (EMP, STATE, PAYCODE, FDWGPYRN)
values ('A', 'OK', '401K', 411.51)
insert into employee (EMP, STATE, PAYCODE, FDWGPYRN)
values ('A', 'OK', 'SALARY', 411.51)
insert into employee (EMP, STATE, PAYCODE, FDWGPYRN)
values ('B', 'TX', 'DISAB', 311.51)
insert into employee (EMP, STATE, PAYCODE, FDWGPYRN)
values ('B', 'TX', '401K', 311.51)
insert into employee (EMP, STATE, PAYCODE, FDWGPYRN)
values ('B', 'TX', 'SALARY', 311.51)
insert into employee (EMP, STATE, PAYCODE, FDWGPYRN)
values ('C', 'LA', 'DISAB', 211.51)
insert into employee (EMP, STATE, PAYCODE, FDWGPYRN)
values ('C', 'LA', '401K', 211.51)
insert into employee (EMP, STATE, PAYCODE, FDWGPYRN)
values ('C', 'LA', 'SALARY', 211.51)
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply