Need Query to select records based off a Quantity column.

  • Thread starter Thread starter AndrewB
  • Start date Start date
A

AndrewB

Hi,

I have a quantity column called 'Qty'. Number values. Quantities range
from say... 1 through 5. Multiple records in the table with many different
quantity values.

I need a query that will, first, count the "Qty's" to 236 and then return
all records in the table relating to those first 236.

Thanks,
 
I don't quite understand the question. Could you post some sample data and
what you expect to have returned?
 
Create your query and open in design view. Look to the icon bar and find an
icon that is a white rectangle with down arrow on the right (pull-down) and
the word 'All' in it. Click in it and type 236 and press ENTER key. It
should display 236.

NOTE - The results will vary on how you sort the records as to what the
first 236 records would be.
 
Hi Karl,

Thanks much but this way does not count the QTY's until 236 is reached and
provide the related records. Your way more so gives the first 236 records.
Any other suggestions?

ajb
 
Hi Jerry,

Sure.

Tally Name Tally Qty Tally Price
SOFTWARE CHANGE 1 $49.00
SOFTWARE CHANGE 3 $147.00
SOFTWARE CHANGE 1 $49.00
SOFTWARE CHANGE 7 $343.00

The customer is allowed 236 Software changes but many months exceed the 236.
I need to capture all records, based off the Tally Qty, that total up to
236. Better yet, supply me all records starting with a sum Tally Qty of 237
and over. I need to highlight the row detail so I can bill these overages.

Hope this helps :-)
 
You lost me.
Are you wanting to total the records until the sum of the QTY field equals
236?
 
Is there a primary key field in that table? Also a customer ID field?

You talk about months. Is there a date field in the table?
 
Back
Top