yudi-ict
30th July 2016, 16:22
Hi master on here ,
i have a little problem on my coding on session code
here is details :
- i have 2 table : cisli310 and whinr431
- im query to table whinh431 by date ( i have no index primary key on there ) because i searching by date
- i want to query and check if no record selected on table cisli310 i want to print and if have data i dont want to print

here we go my code


||| looping for each company |
for i = 1 to 10
comp.current = 700+i

||| ddat.f and ddat.t --> form input range date ( utc format)

switch.to.company(comp.current)
select * from whinr431
where
whinhr431.iadt >= :ddat.f and whinr431.iadt <= :ddat.t
selectdo
switch.to.company(700)
select * from cisli310
where cisli310.shpm =:whinr431.shpm
selectdo
lattr.print= false
selectempty
endselect

rprt_send() ||||send data to report
endselect
endfor




can you help me for fix this code ??
i only can say thank you very much :)

bhushanchanda
30th July 2016, 17:50
Hi,

lattr.print may not work through program script.

Just use rprt_send() for printing and skip if don't want to print. Also, you might need to switch back to current company after selecting cisli310 table.

||| looping for each company |
for i = 1 to 10
comp.current = 700+i

||| ddat.f and ddat.t --> form input range date ( utc format)

switch.to.company(comp.current)
select * from whinr431
where
whinhr431.iadt >= :ddat.f and whinr431.iadt <= :ddat.t
selectdo
switch.to.company(700)
select * from cisli310
where cisli310.shpm =:whinr431.shpm
and cisli310._compnr = 700
selectdo
selectempty
rprt_send() ||||send data to report
endselect
switch.to.company(comp.current)
endselect
endfor

OR

||| looping for each company |
for i = 1 to 10
comp.current = 700+i

||| ddat.f and ddat.t --> form input range date ( utc format)

switch.to.company(comp.current)
select * from whinr431
where
whinhr431.iadt >= :ddat.f and whinr431.iadt <= :ddat.t
selectdo
select * from cisli310
where cisli310.shpm =:whinr431.shpm
and cisli310._compnr = 700
selectdo
selectempty
rprt_send() ||||send data to report
endselect
endselect
endfor