building a query

C

Caleb

Okay, I have a field called OrderId, now OrderId is a number that is placed
one one person for each item they ordered, Each item has its own record.I
want to make a query that will only show one of each OrderId therefore only
one record per person or order.
thanks in advance,
caleb
 
A

Armen Stein

Okay, I have a field called OrderId, now OrderId is a number that is placed
one one person for each item they ordered, Each item has its own record.I
want to make a query that will only show one of each OrderId therefore only
one record per person or order.
thanks in advance,
caleb

Build a Totals query, and use Group By on both PersonID and OrderID.
This will give you one record for each Person/Order combination.

I think your database design may be sub-optimal though. Shouldn't you
have an Order table with another child table holding multiple
OrderDetails?

tblPerson
PersonID
PersonName
....

tblOrder
OrderID
PersonID (foreign key)
OrderDate
....

tblOrderDetail
OrderDetailID
OrderID (foreign key)
OrderDetailQty
ItemID (foreign key to Item table?)
....

Armen Stein
Microsoft Access MVP
www.JStreetTech.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top