PDA

View Full Version : "lookupn" function?????


ABC123

Mike Walsh
04-18-2000, 11:23 AM
What is the correct syntax when using the "lookupn" function when the key value needs to be 2 numeric values
(ie. order_number and line_number). I have tried all sorts of combinations of single quotes, double quotes,
STR( ),etc and nothing seems to work. I have used different indexes on the target table using just numeric values and
and using the STR function
"str(order_number)+str(line_number)" and then tried matching the keyvalue format to the index format, no luck.

Bill Warner
04-18-2000, 01:01 PM
I just tried this, and it worked:

LOOKUPN("F",STR(QTYSHIP,10,0)+STR(QTYRECD,10,0),"AVERAGE","TEST2.DBF","QTY_QTY")

where STR(QTYSHIP,10,0)+STR(QTYRECD,10,0) is a combination of the two numeric fields (your order_number and line_number). I also made an index in the target that was exactly the same. TEST2 is my table name, AVERAGE is the field whose value I chose to look up, and QTY_QTY is the name of the index).

Try it again...sometimes you can miss something so simple you can't even see it.

Mike Walsh
04-18-2000, 01:59 PM
Thanks, I will give it a try.