I have a query UNION in a form
Code: Select all
select product_id, ....
WHERE inventory_code='3' AND quantity >'1'
union
select product_id, ....
WHERE inventory_code='2'
Is there a problem using UNION on Forms?
Thank you.
Code: Select all
select product_id, ....
WHERE inventory_code='3' AND quantity >'1'
union
select product_id, ....
WHERE inventory_code='2'
Code: Select all
select * from product
INNER JOIN (...)
WHERE bom_prodid='#job_prodid#' AND product_category='#partscat#' AND inv_codecli_codecliid='#job_codecli#' AND inv_codecli_active='1' AND inventory_code='STORE3' AND zone_quantity >'1'
UNION
select product_id,IFNULL(product_code,''),IFNULL(inventory_name,''),IFNULL(product_category,''),IFNULL(product_design,''),IFNULL(product_manuf,''),IFNULL(zone_code,''), IFNULL(zone_id,'') from product
INNER JOIN (...)
WHERE bom_prodid='#job_prodid#' AND product_category='#partscat#' AND inv_codecli_codecliid='#job_codecli#' AND inv_codecli_active='1' AND inventory_code='STORE2' AND
product_id NOT IN (SELECT product_id FROM product
INNER JOIN (...)
WHERE bom_prodid='#job_prodid#' AND product_category='#partscat#' AND inv_codecli_codecliid='#job_codecli#' AND inv_codecli_active='1' AND inventory_code='STORE3' AND zone_quantity >'1');