Refining Results from a Query - Beginner Question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BlackEyedPea
    New Member
    • Dec 2009
    • 9

    Refining Results from a Query - Beginner Question

    Hi, I'm very very new to access but hopefully I'm learning quickly. I need some help on what I think maybe as a result of me having a little tunnel vision on my database & confusing myself.

    An example of what I've done...

    I have several tables e.g.

    Table 1
    Product No.------------Stock Holding
    A1-------------------------10

    Table 2
    Product No.-----------Date Despatched----------Qty Despatched
    A1------------------------01/01/2010-------------------3
    A1------------------------02/01/2010-------------------2

    I link the two tables based on the product number & create a query which I want to show the following results...

    Query Required:-
    Product No.------------Stock Holding--------------Date Despatched----QtyDespatched
    A1-------------------------10-------------------------------01/01/2010-------------3
    ---------------------------------------------------------------02/01/2010------------2

    However the query is returning the following....

    Query actually being returned:-
    Product No.------------Stock Holding--------------Date Despatched----QtyDespatched
    A1-------------------------10-------------------------------01/01/2010-------------3
    A1-------------------------10-------------------------------02/01/2010-------------2

    Hopefully its clear that my problem is the product no. & the stock holding figure are returned twice as a result of there being two despatch dates & qty's - what I actually want is for the fields where there is only one set of data to be blank/null, but where they do have more than one result to return to populate accordingly. Does this make sense & is it possible to somehow achieve this or do I need to re-think entirely how I'm trying to get to me results?

    Thanks a lot for your time.
    BEP
  • TheSmileyCoder
    Recognized Expert Moderator Top Contributor
    • Dec 2009
    • 2322

    #2
    That is how the query works. I think in your case what you need to do, is create a report based on your query, and then add "Grouping" on the product ID.

    I can't really outline the whole procedure here, but try to play around with it, and then return here if you have any specific questions.

    Comment

    • nico5038
      Recognized Expert Specialist
      • Nov 2006
      • 3080

      #3
      In a report there's a field property to "suppress duplicate values" when set to "Yes" the result will be as you want.

      Nic;o)

      Comment

      Working...