SubSonic Forums
All Your Database Are Belong To Us

Excluding logical deletes in complex select statement

Latest post 10-22-2008 12:14 AM by ranomore. 1 replies.
  • 10-15-2008 12:22 PM

    • ewitch
    • Not Ranked
    • Joined on 10-08-2008
    • Posts 4

    Excluding logical deletes in complex select statement

    I'm trying to exclude logically deleted items from my Select query but it is not working.

    Here is the SQL I am trying to achieve:

    SELECT * FROM CMSPerson
    WHERE (PersonLastName LIKE 'smith%' OR PersonFirstName LIKE 'smith%')
    AND (Deleted IS NULL OR Deleted = 'False' )  

    And Here is my code:

    CMSPersonCollection coll = new Select().From("CMSPerson")
    .WhereBLOCKED EXPRESSION;

    The wildcard queries work but it still returns deleted records. Any help? Thanks.

    Edit: Well, it won't let my code through but maybe someone can help me anyway...

     

     

     

     

  • 10-22-2008 12:14 AM In reply to

    • ranomore
    • Top 10 Contributor
    • Joined on 11-05-2007
    • Salt Lake City
    • Posts 322

    Re: Excluding logical deletes in complex select statement

    any particular reason you allow NULL on that column? does it have a meaning other than FALSE?

Page 1 of 1 (2 items) | RSS