Hi, I am using the following query in "Edit Data Source" to bring data into Report.fx:
SELECT DISTINCT suppliers.supplier_id, plants.plant_id as pid, scientific_name, inventory.inventory_id as iid, container_desc, containersizes.order,
case (inventory.inventory_price mod 1 > 0)
when true then FORMAT(inventory.inventory_price, 2)
else inventory.inventory_price
end AS inventory_price,
ABS(IF(inventory.inventory_price = 0, 999999, inventory.inventory_price)) as sortorder,
FROM plants
JOIN inventory
ON inventory.plant_id = plants.plant_id
JOIN suppliers
ON suppliers.supplier_id = inventory.supplier_id
JOIN containersizes
ON containersizes.containersize_id = inventory.containersize_id
JOIN priceunits
ON priceunits.priceunit_id = inventory.priceunit_id
WHERE suppliers.supplier_id = {supplier}
AND inventory.inventory_active = 1
AND inventory.deleted = 0
ORDER BY scientific_name ASC, containersizes.order ASC, sortorder ASC
--------
The problem here:
WHERE suppliers.supplier_id = {supplier}
AND inventory.inventory_active = 1
AND inventory.deleted = 0 <------------ WHEN I HAVE TWO "AND" CONDITIONS, THE DATA DOES NOT SORT PROPERLY IN THE REPORT
ORDER BY scientific_name ASC, containersizes.order ASC, sortorder ASC
If I remove either one of the "AND" conditions, the report sorts properly. Can you please give some help. The query works fine when run in Phpmyadmin.
Thanks,
Darryl
Issue with MySQL Query
Re: Issue with MySQL Query
Hello.
Could you provide us a report template with sample data which reproduces the issue.
Thank you.
Could you provide us a report template with sample data which reproduces the issue.
Thank you.