Are conditions in queries handled different in reports?

Sergey Pashkov sergey_pashkov at valentina-db.com
Tue Dec 17 11:35:49 CST 2013


Hi Fabian

I can't reproduce such behavior in my report.
Can you send your project, please?
I have a db.

Thank you.


--
Best regards,
Sergey Pashkov


On Mon, Dec 16, 2013 at 10:44 PM, Fabian Eschrich <info at faesch.de> wrote:

> 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
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macserve.net/pipermail/valentina/attachments/20131217/33af1f28/attachment.html>


More information about the Valentina mailing list