Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find order record where unit number is only after unit #3 1

Status
Not open for further replies.

Louise99

Technical User
Sep 13, 2004
70
US
I have a table where there are many customer numbers. There could be more than one order for each on any given day. I only want to know the records where a customer orders unit #3 and THEN orders something else.

So, my query output would show
Customer Date Unit
AAA 1/1/07 3
AAA 1/1/07 6

So, I just want to see the actual "3" (with the date) and the next unit.

I obviously don't have a clue! Any ideas?

Thanks!
 
Query1:

Code:
Select Customer, [Date]
From Table1
Where Unit = 3

Query2:
Code:
Select Customer, [Date], Unit
From Table1 Inner Join Query1 ON Table1.Customer = Query1.Customer and Table1.Date and query1.Date
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top