eric.dizon
9th December 2013, 18:56
Using query.extend.________ functionality I would like to formulate this following query. It shows no result for both REFERS TO and the following filter

query.extend.where("tccom140.bpid = tccom100.bpid AND tccom100.cadr = tccom130.cadr ")

Can anyone show me how can i apply this query in either query.extend
or is it possible to accomplish same result in main.table.io section ?


This is the query in T-SQL.

SELECT ttccom140600.t_ccnt, ttccom140600.t_finm, ttccom140600.t_surn, ttccom140600.t_jobt, ttccom140600.t_bpid, ttccom140600.t_telp, ttccom140600.t_info,
ttccom100600.t_nama, ttccom100600.t_cadr ,
ttccom130600.t_nama, ttccom130600.t_namc, ttccom130600.t_ccty
FROM ttccom140600 INNER JOIN ttccom100600 ON ttccom140600.t_bpid = ttccom100600.t_bpid
INNER JOIN ttccom130600 ON ttccom130600.t_cadr = ttccom100600.t_cadr

eric.dizon
9th December 2013, 20:21
This describes my issue better.

http://www.baanboard.com/system/files/u21623/query_extend.pdf

JaapJD
12th December 2013, 09:48
You have to use the Input/Reference Expression in the DFE for the tccom130.nama, tccom130.namc, tccom130.ccty fields. I'm not completely surr, but I think it should be: tccom140.bpid, tccom100.cadr. See also the help of DFE.

eric.dizon
12th December 2013, 21:41
Hi Jaap, thanks for the glimmer hope. I have tried putting values (tccom140.bpid, tccom100.cadr) in the Ref. Expression field of tccom130.nama . I still get the same erorr that indicates tccom130 is referred by different tables. Am I missing something still?

eric.dizon
12th December 2013, 22:10
Hi Jaap, I spoke to soon that did it for me. What I was not doing is setting Field type from Input to Display. And I don't have to define my
query.extend.where("tccom140.bpid REFERS TO tccom100 AND tccom100.cadr REFERS TO tccom130 ") because I think relation is already in there.

Thanks a lot JaapJD and mark_h. Till my next inquiry :)