How To Show All Other Records When Using A Critieria In Query Design?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sg2808
    New Member
    • Mar 2012
    • 91

    How To Show All Other Records When Using A Critieria In Query Design?

    Hello,

    I will give a simple example. I have a table [RuleMap]. It has a field called [Rulename] and[Ruletype]. [Ruletype] has entries like Handbook, Guidance and Legislation. Some of the records do not have the [Ruletype] mentioned against [Rulename].

    I have designed a query in the Query design view. I do not want to see the [Rulename] where [Ruletype] is Legislation. I have used "<> Legislation" in the criteris for [Ruletype].

    The query is working fine but it is not showing the records [Rulename] where the [Ruletype] is blank.

    How do I show all records even where the [Ruletype] is blank?

    Please advise.

    Thanks.
    SG.
  • sg2808
    New Member
    • Mar 2012
    • 91

    #2
    Got it... I added "Is Null" in the Or field below.

    Comment

    • roshan ban
      New Member
      • Apr 2012
      • 21

      #3
      Try This Code
      Code:
      Select *
      From RuleMap
      Where RuleType Not in ('Legislation')
      Last edited by NeoPa; Apr 29 '12, 10:43 AM. Reason: Added mandatory [CODE] tags for you.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32633

        #4
        A clever idea, but unfortunately it doesn't work.

        It would be a good idea to indicate, when posting, that you are guessing and haven't actually tested your suggestions. Members generally assume a suggestion has either been tested specifically, or is posted by someone who has a fair set of experience in the subject. If neither of these is true then it's only fair to indicate that in your posts.

        Comment

        Working...