Results 1 to 3 of 3
  1. #1
    showe2295 is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2011
    Posts
    3

    Adding values to equal total

    Hi. I'm trying to create a query that will take a list of quantites and add them to total a given quantity. I have a table with hundreds of individual records. I input a quantity and the query tries to find that exact quantity or multiple quantities that when added equal that quantity. I would also like it to use the least amount of records to do so. For instance, I have a quantity of 613. I'm looking for one of the following results...one entry in a table that = 613, 2 entires that toal 613 (e.g. 300 and 313), three that equal 613 and so on. I do not want 613 records of 1 to show up. Is this possible?
    Thanks

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    You need to group the records by something other than the quantity. Then you can total all the quantities for that group. Use the "Totals" for this. Once you have a query with all the totals you can easily find ones that equal any number.

  3. #3
    showe2295 is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2011
    Posts
    3
    I don't think I clearly explained my issue. I'm looking to input a value, let's say 524. I need to have the query seach a list of individual numerical records and find one record that matches 524. If not, I'd like for it to find two records that when totaled = 524. If there is not two records, I need the query to continue to search for the fewest records to meet my original value.

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

Similar Threads

  1. Replies: 7
    Last Post: 09-16-2011, 01:39 PM
  2. Replies: 2
    Last Post: 06-09-2011, 12:11 PM
  3. Linked tables need values that are NOT EQUAL
    By gus1339 in forum Queries
    Replies: 3
    Last Post: 04-11-2011, 06:55 PM
  4. Adding a total to a subreport?
    By degras in forum Reports
    Replies: 3
    Last Post: 01-25-2011, 10:30 AM
  5. Replies: 2
    Last Post: 01-13-2010, 05:29 AM

Tags for this Thread

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