Hello,
I have problem with SQL in Quick Report. I write this SQL query:
SELECT CASE
WHEN COUNT(CASE WHEN parent_part_status <> 'B' THEN 1 END) = 0 THEN 0
ELSE NULL
END AS result
FROM MANUF_STRUCTURE
WHERE component_part = :component_part
GROUP BY component_part; this retrieves nothing in both comp parts)
SELECT CASE
WHEN COUNT(CASE WHEN parent_part_status <> 'B' THEN 1 END) = 0 THEN 0
ELSE NULL
END AS result
FROM MANUF_STRUCTURE
WHERE component_part = ‘U010805’
GROUP BY component_part; (retrieves 0, which is good)
SELECT CASE
WHEN COUNT(CASE WHEN parent_part_status <> 'B' THEN 1 END) = 0 THEN 0
ELSE NULL
END AS result
FROM MANUF_STRUCTURE
WHERE component_part = ‘U010751’
GROUP BY component_part; (retrieves nothing, which is good)
I am using tab → component where used, every component part has some part numbers and every part number has parent_part_status, which belongs in 2 categories - B,A (blocked, active). My problem is when i want to input in “:component_part” item U010805, which has 4 part no and every part_no has parent_part_status = B => in this case I want to display in new columns “Has superior part” 0. And I have second component part U010751 which has 4 part no with parent_part_status = B and two part no with parent_part_status = A, in this case i want to display nothing (NULL value). But problem is when I input this dynamically in “:component_part”, in both case returns nothing.
I also tried to find column Buildable Structures Only in SQL, but I cant find it, so I dont know if this component is working only with parent_part_status
How can I solve this?
Thanks