Page 1 of 1
Partial key lookup
Posted: Wed Mar 10, 2004 9:54 am
by Keith_Hill_(Guest)
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__
=> RE: Partial key lookup
Posted: Wed Mar 10, 2004 11:12 am
by Robert_Seidman
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
Posted: Wed Mar 10, 2004 11:52 am
by keith
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
Posted: Wed Mar 10, 2004 2:25 pm
by keith
I finally got this working.____Thanks
===> RE: Partial key lookup
Posted: Wed Mar 10, 2004 2:25 pm
by kfleming
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