username
23rd April 2013, 07:24
Hi,
I need to link 2 tables in crystal report, tcibd001 and cprrp100. I am having a problem to link the primary key because tcibd001.item is starts from position 10 while cprrp100.item starts from position 13. So how can I link these two tables?

Thanks.

bhushanchanda
23rd April 2013, 10:38
cprrp100.item has a string length of 50 characters and the item code starts from position 13.
tcibd001.item has a string length of 47 characters and the item code starts from position 10.

select tcibd001.*
from tcibd001
selectdo
select cprrp100.*
from cprrp100
where cprrp100.item(13;38) = :tcibd001.item(10;38)
selectdo
endselect
endselect

vahdani
23rd April 2013, 12:25
Hi,

you have to link the two tables cprrp100 and tcibd001 using the third "planning items" table cprpd100:


select cprrp100.*, tcibd001.*
from cprrp100, cprpd100, tcibd001
where cprpd100.plni = cprrp100.item
and tcibd001.item = cprpd100.item