sharika_ganju
New Member
Hello All,
I needed some help. I have a for statement with the following break by -
for each xshd_det no-lock where ...... use-index xshd_shipdate,
each ad_mstr no-lock where....... use-index ad_addr,
each pt_mstr no-lock where..... use-index pt_part,
each ih_hist no-lock where ...... use-index ih_nbr,
each cm_mstr no-lock where .... use-index cm_addr
break by
(if sortby = "M" then pt_site else
if sortby = "S" then xshd_line_site else
if sortby = "P" then xshd_part else
if sortby = "B" then pt_buyer else
xshd_cust)
with down frame b:
....
....
end.
Now I want to use the corresponding domain fields in the break by. How do I do the same.
The following query does not work -
for each xshd_det no-lock where ...... use-index xshd_shipdate,
each ad_mstr no-lock where....... use-index ad_addr,
each pt_mstr no-lock where..... use-index pt_part,
each ih_hist no-lock where ...... use-index ih_nbr,
each cm_mstr no-lock where .... use-index cm_addr
break by
(if sortby = "M" then pt_domain by pt_site else
if sortby = "S" then xshd_domain by xshd_line_site else
if sortby = "P" then xshd_domain by xshd_part else
if sortby = "B" then pt_domain by pt_buyer else
xshd_cust)
with down frame b:
....
....
end.
How do we put multiple fields in the break by clause if it is done conditionally.
Thanks in advance.
I needed some help. I have a for statement with the following break by -
for each xshd_det no-lock where ...... use-index xshd_shipdate,
each ad_mstr no-lock where....... use-index ad_addr,
each pt_mstr no-lock where..... use-index pt_part,
each ih_hist no-lock where ...... use-index ih_nbr,
each cm_mstr no-lock where .... use-index cm_addr
break by
(if sortby = "M" then pt_site else
if sortby = "S" then xshd_line_site else
if sortby = "P" then xshd_part else
if sortby = "B" then pt_buyer else
xshd_cust)
with down frame b:
....
....
end.
Now I want to use the corresponding domain fields in the break by. How do I do the same.
The following query does not work -
for each xshd_det no-lock where ...... use-index xshd_shipdate,
each ad_mstr no-lock where....... use-index ad_addr,
each pt_mstr no-lock where..... use-index pt_part,
each ih_hist no-lock where ...... use-index ih_nbr,
each cm_mstr no-lock where .... use-index cm_addr
break by
(if sortby = "M" then pt_domain by pt_site else
if sortby = "S" then xshd_domain by xshd_line_site else
if sortby = "P" then xshd_domain by xshd_part else
if sortby = "B" then pt_domain by pt_buyer else
xshd_cust)
with down frame b:
....
....
end.
How do we put multiple fields in the break by clause if it is done conditionally.
Thanks in advance.