query results

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • oh patty

    #1

    query results

    I have a query that finds results that meet any 1 of 3 criteria. It is
    possible for each record to meet 0, 1, 2, or all 3 of the criteria.
    When I run the query, each record will show up once for each of the
    criteria it meets. Is there any way to return a record only once, no
    matter whether it meets 1, 2, or 3 of the criteria?

  • Rick Brandt

    #2
    Re: query results

    oh patty wrote:[color=blue]
    > I have a query that finds results that meet any 1 of 3 criteria. It
    > is possible for each record to meet 0, 1, 2, or all 3 of the criteria.
    > When I run the query, each record will show up once for each of the
    > criteria it meets. Is there any way to return a record only once, no
    > matter whether it meets 1, 2, or 3 of the criteria?[/color]

    Post your query. That is not normal behavior.

    EX: If I have a record...

    FirstName=John
    LastName=Smith
    MiddleName=Joe

    And a query of...

    SELECT * From TableName
    WHERE FirstName = "John"
    OR LastName = "Smith"
    OR MiddleName = "Joe"

    ....it will return exactly one copy of the record even though it satisfies all
    three criteria.


    --
    I don't check the Email account attached
    to this message. Send instead to...
    RBrandt at Hunter dot com


    Comment

    • oh patty

      #3
      Re: query results

      Query is the following 3 Rows of criteria. Each record can have
      multiple entries under the "MODEL" field:

      Row 1: MODEL="F/A-18 E" and CUM="Between 136 And 160"
      or
      Row 2: MODEL="F/A-18 F" and CUM="Between 190 And 202"
      or
      Row 3: MODEL="E/A-18G" and CUM="Between 1 And 4"


      Rick Brandt wrote:[color=blue]
      > oh patty wrote:[color=green]
      > > I have a query that finds results that meet any 1 of 3 criteria.[/color][/color]
      It[color=blue][color=green]
      > > is possible for each record to meet 0, 1, 2, or all 3 of the[/color][/color]
      criteria.[color=blue][color=green]
      > > When I run the query, each record will show up once for each of the
      > > criteria it meets. Is there any way to return a record only once,[/color][/color]
      no[color=blue][color=green]
      > > matter whether it meets 1, 2, or 3 of the criteria?[/color]
      >
      > Post your query. That is not normal behavior.
      >
      > EX: If I have a record...
      >
      > FirstName=John
      > LastName=Smith
      > MiddleName=Joe
      >
      > And a query of...
      >
      > SELECT * From TableName
      > WHERE FirstName = "John"
      > OR LastName = "Smith"
      > OR MiddleName = "Joe"
      >
      > ...it will return exactly one copy of the record even though it[/color]
      satisfies all[color=blue]
      > three criteria.
      >
      >
      > --
      > I don't check the Email account attached
      > to this message. Send instead to...
      > RBrandt at Hunter dot com[/color]

      Comment

      • Strasser

        #4
        Re: query results

        oh patty wrote:[color=blue]
        > I have a query that finds results that meet any 1 of 3 criteria. It[/color]
        is[color=blue]
        > possible for each record to meet 0, 1, 2, or all 3 of the criteria.
        > When I run the query, each record will show up once for each of the
        > criteria it meets. Is there any way to return a record only once, no
        > matter whether it meets 1, 2, or 3 of the criteria?[/color]

        Strasser
        First:
        Must change the displayed records so that duplicate lines are
        identical.
        Could do this by deleting or making invisible fields.
        Second:
        Must be in the design view of the query: View ==> SQL View ==>
        display the SQL View
        Look at first line, first word should be SELECT
        Enter a space, the word DISTINCT and a space
        This is telling Access:
        "Compare each displayed line to lines above it"
        "Any line that is exactly like the line above it, only display
        once.
        Result is one DISTINCT line is displayed, no matter how many times the
        same line would have appeared if the word "DISTINCT" was not entered in
        the SQL View of the query design.

        Comment

        • oh patty

          #5
          Re: query results

          Awesome, Thanks!

          Comment

          Working...