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

OR instead of AND

edited September 2004 in General
Hi,

Report builder 7

Using the DADE and use the Query designer.

I can set the SEARCH criteras as AND but how to set up an OR between two
expressions i.e.instead of

WHERE
( INSPCHECK_BASKET_1.CONNECTED_INSPCHECK IN ('A1') )
AND ( INSPCHECK_BASKET_1.CONNECTED_INSPCHECK IS NULL )
I want

WHERE
( INSPCHECK_BASKET_1.CONNECTED_INSPCHECK IN ('A1') )
OR ( INSPCHECK_BASKET_1.CONNECTED_INSPCHECK IS NULL )


/Ronny

Comments

  • edited September 2004
    Ignore my previous article.
    I found the right click and "Insert OR"

    But how to do this from within Delphi

    /Ronny
  • edited September 2004
    -------------------------------------------------
    Tech Tip: How to add OR criteria in code
    -------------------------------------------------

    The 'And' operator is implied. To add an Or, Begin, End to the criteria
    you need to extract the TdaSQL object and then use
    TdaSQL.InsertCriteria. Below is the function declaration.

    function InsertCriteria(aPosition: Integer; aType: TdaCriteriaType):
    TdaCriteria;


    TdaCriteriaType is defined in TdaSQL.pas as

    TdaCriteriaType = (dacrField, dacrOR, dacrNOT, dacrBegin, dacrEnd);


    A call would look like

    lSQL.InsertCriteria(0, dacrOR);


    --
    Tech Support mailto:support@digital-metaphors.com
    Digital Metaphors http://www.digital-metaphors.com

    --


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.