Please bare with this message, I have put in detail to make the problem clearer.
Example Data in view:
COLUMN1 | COLUMN2
T002-05012006 | 15
T002-05012006 | 5
T003-05012006 | 10
I am using @DbLookup to return a list of numbers, of which I then perform @Sum to summarise the results. This generally works, apart from Scenario 3 (below is an example of three scenarios):
Scenario 1 (ONE Key):
searchSTR := “T002-05012006”;
LU := @DbLookup(“”:“NoCache”;“”;viewname;searchSTR);
@If(@IsError(LU);0;@Sum(LU))
THIS RETURNS 20 (CORRECT)
Scenario 2 (TWO Keys):
searchSTR := “T002-05012006,T003-05012006”;
LU := @DbLookup(“”:“NoCache”;“”;viewname;searchSTR);
@If(@IsError(LU);0;@Sum(LU))
RETURNS 30 (CORRECT)
Scenario 3 (TWO Keys):
searchSTR := “T001-05012006,T002-05012006”;
LU := @DbLookup(“”:“NoCache”;“”;viewname;searchSTR);
@If(@IsError(LU);0;@Sum(LU))
RETURNS 0 (i.e. Error - NOTCORRECT)
Basically, because the first key doesn’t exist it returns an error (or zero as I handle the error) and doesn’t go onto search for the second key.
We can have ONE or MORE keys.
Any ideas before I start coding an @For loop.
Thanks for any help/advice.