Partial key lookup
-
- Posts: 2
- Joined: Tue Oct 10, 2017 12:44 pm
Partial key lookup
I am trying to do a partial key lookup. The index of the related file, FileB, is made up of four fields:__EEID2 (char 9), CKNO2 (char 9), CHDT2 (date), CLMNO2 (char 12)____I only have the first three of those fields in the master, FileA.__EEID1 (char 9), CKNO1 (char 9), CHDT1 (date)____I created a calculated field joining those three fields like so:__FileB_key: EEID1+CKNO1+DTOC(CHDT1,1)____The relationship is defined like this:__Linking field: FileB_key__Partial__Partial match length: 26 (the entire length of the partial key)__Scan - there may be more than one record in FileB that matches__Related file: FileB.DBF__Alias: FileB__Index file: FileB.NTX__Blank____I^m not getting any hits. I know that there are matches because I can query the tables with Access and get the desired results. Any suggestions? We are using the old Xbase version of R&R.____Thanks,__Keith__
-
- Posts: 62
- Joined: Tue Oct 10, 2017 12:44 pm
=> RE: Partial key lookup
Does the format of the string returned from your DTOC function match the format of your index.____R&R help defines the DTOC function:__"When the optional numeric argument is 1, DTOC returns a character string in the format yyyymmdd"____If your date index doesn^t follow that format, you won^t get a match.____Good luck.____RHS
==> RE: Partial key lookup
You asked," When the optional numeric argument is 1, DTOC returns a character string in the format yyyymmdd"____Yes. I looked at the .NTX file in a viewer, and this is exactly how it is displayed. For example, the first index record is:____11122333390000219920040301SPR040570079____|>>>>>>>|>>>>>>>>|>>>>>>>|>>>>>>>>>>>|__| EEID | CKNO | CHDT | CLMNO____As you can see, the 3rd part of the index is in yyyymmdd format. That is why I chose the optional argument for the DTOC function.____Any suggestions?____Thanks
===> RE: Partial key lookup
I finally got this working.____Thanks
===> RE: Partial key lookup
Have you tested using fewer characters as your match length to see if you get any results at all? I would first try just the 9 characters for the first field and see if that much works.____Kathleen__R&R Support