suhas-mahajan
29th January 2003, 09:14
Dear All,
Can anybody give me example of _compnr field using IN operator?
I want to show records of perticular table for the company no. which I entered through form.
-Suhas
maximus
29th January 2003, 09:27
select tdsls400.*
from tdsls400
where tdsls400._index1 inrange {:orno.f} and {:orno.t}
and tdsls400._compnr = :comp.on.form
selectdo
....
....
....
endselect
"where the comp.on.form is your form variable in which you will input the company number"
I guess this struc ha some limitations, I am not sure, but you may test and verify.
regards
Max
NPRao
29th January 2003, 09:59
Refer to - Company numbers (http://www.baanboard.com/programmers_manual_baanerp_help_functions_database_handling_company_numbers)
suhas-mahajan
29th January 2003, 10:41
Dear Max / NRao,
I tried both ways but problem not yet solved, please give me example.
-Suhas:confused:
Paul P
29th January 2003, 11:06
Dear Suhas,
Probably it'd be more helpful if you could provide more details. If you're trying to show those records on a report, then Max's example would've worked. If you're trying to show records from other company in a form, however, it wouldn't work unless you have a multi company set up. So where are you trying to show those records on?
Rgds,
Paul
suhas-mahajan
29th January 2003, 11:25
Dear Paul,
If we use _compnr in where, BaaN will allow only constant and IN operator, using this criteria Max's query is incorrect, that why I am asking to send me example using IN operator.
My query:
select tccom020.suno, tccom020.nama, tcs010.dsca, tccom020.namc,
tccom020.name, tccom020.pstc, tdind012.lstn, tdind012.lstd,
tdind012.cstn, tdind012.cstd, tdind012.rang, tdind012.divn,
tdind012.pano, tccom020.telp, tccom020.tefx, tccom020._compnr
from tccom020, tdind012, tcmcs010
where tccom020.suno = tdind012.suno and
tccom020.ccty = tcmcs010.ccty and
tccom020._compnr IN
(select tccom000.ncmp from tccom000
where tccom000.ncmp between :cucomp.f and :cucomp.t)
This is incorrect, please correct it or give me new solution, hope you understand my problem.
-Suhas
isimeon
29th January 2003, 13:47
Try this
select tccom020.suno, tccom020.nama, tcs010.dsca, tccom020.namc,
tccom020.name, tccom020.pstc, tdind012.lstn, tdind012.lstd,
tdind012.cstn, tdind012.cstd, tdind012.rang, tdind012.divn,
tdind012.pano, tccom020.telp, tccom020.tefx, tccom020._compnr, tccom000.ncmp
from tccom020, tdind012, tcmcs010, tccom000
where tccom020.suno = tdind012.suno and
tccom020.ccty = tcmcs010.ccty and
tccom000.ncmp between :cucomp.f and :cucomp.t and
tccom020._compnr = tccom000.ncmp
suhas-mahajan
31st January 2003, 07:50
Dear isimeon,
Thanks using your query, my problem has been solved, I unncessory choose difficult way.
Thanks.
-Suhas