Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

HELP With DataView Where Search Criteria

edited April 2006 in General
Hi All.

I'm using ReportBuilder 9.01. I've got a DataView created for my report
using the "Data" tab in the RBuilder IDE.


How do I add a search criteria to the WHERE clause of my SQL to compare
two fields in the same result set?

In other words how can I do this in the WHERE clause


SELECT FIELD1, FIELD2
FROM SOME_TABLE
WHERE FIELD1 <> FIELD2


It seems that ReportBuilder only allows literal values to be specified
on the right-hand side of the comparison.

Please help.

Regards,
Paul

Comments

  • edited April 2006
    Hi Paul,

    It is possible to manually enter in the field name into the Value edit box
    of the search tab in the Query Designer. For instance, if searched on
    Orders.AmountPaid and entered Orders.ItemsTotal into the Value edit box with
    an "equals" comparison, the resulting SQL could look like the following...

    SELECT Orders.CustNo, Orders.OrderNo
    FROM Orders
    WHERE (Orders.AmountPaid = Orders.ItemsTotal)
    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2006
    Awesome!

    Thanks for the info. I had no idea that was legal.

    Regards,
    Paul

This discussion has been closed.