Approximate Lookup

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
Terry_Price
Posts: 2
Joined: Tue Oct 10, 2017 12:44 pm

Approximate Lookup

Post by Terry_Price » Fri Nov 28, 2003 5:42 pm

I understand that the "Approximate Lookup" makes a relational match that is equal to or greater than the link field in the controlling table. Is there a way to make that equal to or less than? I need the match to be the record below the link field, not the record above. Any help would be greatly appreciated.____THANKS__Terry

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: Approximate Lookup

Post by kfleming » Sat Nov 29, 2003 4:51 pm

I cannot think of a good way to get there.____Kathleen__R&R Support

Terry_Price
Posts: 2
Joined: Tue Oct 10, 2017 12:44 pm

==> RE: Approximate Lookup

Post by Terry_Price » Mon Dec 01, 2003 11:13 am

Since I can^t go backwards, is there a way to capture the "relative" position of a record based on the current index? I know how to capture the record number, but that is not useful. But the "relative" position may help me find the record preceeding it.____JUST HOPING!!!____THANKS__Terry

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

===> RE: Approximate Lookup

Post by kfleming » Mon Dec 01, 2003 2:31 pm

One roundabout thing that you could do is to create a second report that uses that related table and corresponding index as the master file/index.__You could then create a calculated field with expression RECNO()that would give you the current position and a second calculated field with the expression RECNO(alias) where alias is the alias name of the master file. This gives you the physical record number from the file.__You then add the fields that form the index key and export the whole lot to a DBF.__You then do the approximate lookup to this new table using the key fields. You then create a calculated field that is the exported RECNO field minus 1. This calc is then used as a link to the same table. When we find that record we have the key for the previous record as well as its record number from the real file so if you need more fields from the real guy you can build a relation based on the RECNO(alias) field.__Sort of kludgy but if your files are reasonably small and static this would get you there.______Kathleen__R&R Support

Post Reply