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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do i number my records in Access? 1

Status
Not open for further replies.

Akart

IS-IT--Management
Nov 14, 2002
71
0
0
AU
Hello,

I am trying to count the number of orders sent to a customer and number the records. There is one record for each order.

Customer A had 4 orders 1,2,3,4
Customer B had 3 orders 1,2,3
Each record has a package number field that needs to have the correct number.
This is so the users can see while looking at a record, that this is the customers 2nd order etc.
Please help!

Akart
 
select count(*) from order where customer=your_customer_id

This could be put into the overall select as follows:-

select c.name, c.address, c.id, (select count(*) from orders where orders.customer_id = c.id) as No_Of_Orders from customers c where xxxxxxxxxx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top