Are conditions in queries handled different in reports?
Fabian Eschrich
info at faesch.de
Mon Dec 16 14:44:26 CST 2013
Hi,
I have a query with some conditions. This query returns 17 rows where
products.categoryid IS NULL.
SELECT
transaction_items.id,
transaction_items.article_id,
transaction_items.productid,
transaction_items.product,
transaction_items.quantity,
transaction_items.net,
products.categoryid,
product_categories.name,
transactions.number,
transactions.tdate,
IF(productid IS NULL,transaction_items.id,productid) AS groupingid,
IF(products.categoryid IS NULL,'Free
Product',product_categories.name) AS categoryname
FROM transaction_items
JOIN transactions ON transaction_items.transactionid = transactions.id
LEFT OUTER JOIN products ON transaction_items.productid = products.id
left outer join product_categories on products.categoryid =
product_categories.id
where transactions.tdate >= $P(startdate) AND transactions.tdate <=
$P(enddate)
AND (transactions.`type` = 'invoice' OR transactions.`type` = 'creditmemo')
But when I use this query for a report, these records are missing.
When I add
"AND products.categoryid IS NULL" to the query to filter only for these,
the report is empty.
Is the query handled in a different way when running in report?
To test I made a quite simple report and added all information to the
body. Nothing there.
Best regards
Fabian
More information about the Valentina
mailing list