Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter list Not in table 1

Status
Not open for further replies.

AllpayRog

Technical User
Nov 10, 2008
17
0
0
GB
Hi All,

I want to be able to show codes which a parameter cannot find in a table, but I can't figure out the formula to do it.
Example: In a table under the CODE column are 6 codes AAA, BBB, CCC, DDD, EEE & FFF.
In my report I have a parameter promting for codes to search for. When prompted I enter the codes AAA, BBB, CCC and GGG.
I need the formula to say "Codes not found: GGG".
Anyone know how?

Best Regards to all.
Roger
 
Create a formula to place in the detail section:

whileprintingrecords;
stringvar y;
numbervar i;
numbervar j := distinctcount({table.code});
for i := 1 to j do (
if instr(y,{table.code}) = 0 then
y := y + {table.code} + ", "
);

In the report footer, add this formula:
whileprintingrecords;
stringvar array x := {?code};
stringvar y;
numbervar i;
numbervar j := ubound(x);
stringvar z;
for i := 1 to j do(
if not(x in y then
z := z + {?code} + ", "
);
if len(z) > 2 then
left(z,len(z)-2);

-LB
 
Hi LB,

The first formula is in the detail and checks fine.
I have put the second in the footer as you say and substituted the parameter name with the one I am using. When I check the formula I get the message "The ) is missing" and the 'then' from 'if not(x in y then z....'is highlighted. There does seem to be a ) missing but I'm not sure where to put it.

Cheers
Roger
 
Sorry, it should be:

whileprintingrecords;
stringvar array x := {?code};
stringvar y;
numbervar i;
numbervar j := ubound(x);
stringvar z;
for i := 1 to j do(
if not(x in y[red])[/red] then
z := z + {?code} + ", "
);
if len(z) > 2 then
left(z,len(z)-2);

-LB
 
Hi LB,
Almost there....
I get an error message "This array must be subscripted. For example: Array". The text 'z + {?Client Code(s)} + ", "' is highlighted.

Thanks for your help, bye the way, LB. This is very much appreciated.

Roger.
 
That's the problem with doing stuff from memory. It should be:

whileprintingrecords;
stringvar array x := {?code};
stringvar y;
numbervar i;
numbervar j := ubound(x);
stringvar z;
for i := 1 to j do(
if not(x in y) then
z := z + [red]x[/red] + ", "
);
if len(z) > 2 then
left(z,len(z)-2);

-LB
 
Hi LB

This works a treat....fantastic....and from memory!!

I very much appreciate your help on this and it's got me fired up to learn more programming too.

Thanks once again...
Best Regards
Roger.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top