Finding the oldest date.

Dana5535

New Member
Joined
Mar 30, 2015
Messages
12
I have a access database for bills and customers. I need a query that will give me the oldest bill for each customer. Not sure where to even start.
I have a table for Customers and a table for bills. They are "linked" by the customer number. I found help that allowed me to find the oldest of all the bills but not the oldest for each customer. At this time I have approximately 800 customers and 1,600 bills.

Any suggestions? Please keep it kind of simple, a relative newbie to Access.

Thanks,
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Hello again!

This is actually pretty simple to do in Access, with an Aggregate (Totals) Query.
Just create a new query, and add just your Customer field and bill date field to the Query.
Then click on the Totals button (looks like a Sigma).
This will add a new row under each field named "Totals" with the words "Group By" under each of your two fields.
Under the bill date field, change "Group By" to "Min".
Now view the results. This should give you what you want.

Literally, you are "Grouping" all the data on the Customer field and taking the "minimum" value of the bill date field for each "group".
 
Upvote 0
In a query select your tables and hopefully you will see the relationships between the tables.
Next use the Autosum Icon which will Group by and make sure company is grouped and the invoices select Last from the drop down in the Group this will give you what you want.
 
Upvote 0

Forum statistics

Threads
1,221,889
Messages
6,162,624
Members
451,778
Latest member
ragananthony7911

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top