Results 1 to 3 of 3
  1. #1
    chrisjmcqueen is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    2

    Query values based on the values of another record in a different table

    Hey guys

    I am pretty novice with access,

    The data I have relates to the number of fish logged against the flow rate at that time.
    I do not have the dates as they are irrelevant, they are all logged within one year.

    I have another table with percentages split into 1,2,3,4,5 etc and the highest value flow rate and the lowest value flowrate allowed within that percentile.
    fish records.accdb



    What I need help is with totalling the number of fish in each percentile.


    so far I have only been able to query the tables based on entering a percentage myself. I queried percentile value 40 and it came back with a number of fish totals where the flowrate sat between the Value A and Value B for 40 percent.


    I hope I have explained myself well,
    I appreciate any assistance in solving my problem

    Thanks
    C

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Would have been nice if you had included the query you built.

    Do a GROUP BY (Totals) aggregate query. With query in Design View, click Totals from the design tab on ribbon. Access Help has guidelines.

    The sql statement is:

    SELECT DLookUp("Percentage","percentage",[FlowRate] & " Between RangeA And RangeB") AS Percentage, Count(fish.SalmonNumber) AS CountOfSalmonNumber
    FROM fish
    GROUP BY DLookUp("Percentage","percentage",[FlowRate] & " Between RangeA And RangeB");
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    chrisjmcqueen is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    2
    GENIUS

    Worked perfectly, thank you for taking the time to help me

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 10-29-2012, 08:15 AM
  2. Replies: 2
    Last Post: 05-17-2012, 03:52 PM
  3. Replies: 8
    Last Post: 02-26-2012, 09:48 PM
  4. Replies: 7
    Last Post: 11-13-2010, 08:08 AM
  5. Replies: 1
    Last Post: 03-27-2010, 06:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums