Extracting First and Last Dates

gmath

Registered User.
Local time
Today, 14:54
Joined
Feb 9, 2015
Messages
17
I have purchase history that contains multiple part numbers, multiple customers with multiple purchase dates. I'm trying to extract the min date and the max date that each customer may have purchased a particular part number. I was thinking I could do this with a query, but I'm running into problems.

Does anyone have any suggestions
 
What problems are you running into? If possible demonstrate with data.
 
We need to know more about your table(s) structure. A sample of a few records would be helpful to readers.
 
Try using DMax() and DMin()
Use the PartID as the criteria
 
Sorry, I guess I stopped mid sentence when I was saying what I was having problems with.
I'm having problems determining the best way to go about getting the results I am looking for, and determining how to end up with a table with the information I need. I'm using Access 2013.

I'm building a database that is pulling information from a lot of different sources to reach a simple end result. The next piece I need to be pretty close to done is to get the attached data in the format as shown on the tab "What I would like to see".

I messed around with Dmin and Dmax, but not sure how to actually get it to work.

Thanks in advance for your advice and help.
 

Attachments

try this query

"SELECT Product, AccountName, min(InvoiceDate) as FirstDate, max(InvoiceDate) as LastDate
FROM myTable
GROUP BY Product, AccountName"
 

Users who are viewing this thread

Back
Top Bottom