Query based on Many to Many Relationship (1 Viewer)

navi95

Registered User.
Local time
Today, 00:32
Joined
Jan 3, 2013
Messages
59
Hi,

I am currently designing an ordering system with a many to many relationship. I have gotten the foundation to work, to take orders, but since an order can compose of several different items or same items but each one modified I have a junction table which records every single item ordered.

I hope this makes sense so far lol. Right.

Now I have made a query which is meant to show this Driver1 took these orders and the results look like this:


Thats great, BUT, I dont want Bestellnumm (sorry, im working on this in german but english is my native language hence why Im asking on an English site) to appear 3 times as its a single order.
So, I need all 3 records to be grouped together AND all the values of Total Price to be summed up too.

Using the "show no duplicates" in the properties of the query didnt help much as in each line, there is a different thing ordered for the same order ID.

Any thoughts?
 

stopher

AWF VIP
Local time
Today, 08:32
Joined
Feb 1, 2006
Messages
2,395
If you want to display on screen then use a form. If you want to output the use a report. Both tools are designed to group and total as you request.
 

plog

Banishment Pending
Local time
Today, 02:32
Joined
May 11, 2011
Messages
11,668
Please demonstrate your issue with data. Provide 2 sets:

A. Starting data from your table(s). Include table and field names and enough data to cover all cases.

B. Expected results of A. Show what you want the query to return when you feed it the data in A.
 

navi95

Registered User.
Local time
Today, 00:32
Joined
Jan 3, 2013
Messages
59
If you want to display on screen then use a form. If you want to output the use a report. Both tools are designed to group and total as you request.

I need this part for the screen so it will be a form. I just need to refine the data being shown by the query.
 

navi95

Registered User.
Local time
Today, 00:32
Joined
Jan 3, 2013
Messages
59
Please demonstrate your issue with data. Provide 2 sets:

A. Starting data from your table(s). Include table and field names and enough data to cover all cases.

B. Expected results of A. Show what you want the query to return when you feed it the data in A.

All the fields are in the screenshot I posted up. So basically I want the first 3 lines to be grouped and it should show like this:

Bestellnummer Telefonummer Addresse Ort ..etc.... Total Preis
10 545566 Per London €124
12 602700 Bo Bham €28
 

stopher

AWF VIP
Local time
Today, 08:32
Joined
Feb 1, 2006
Messages
2,395
Ah, so you want to summarise the data and not show the details? So you should google aggregate queries. They are dead easy to do.
 

navi95

Registered User.
Local time
Today, 00:32
Joined
Jan 3, 2013
Messages
59
Ah, so you want to summarise the data and not show the details? So you should google aggregate queries. They are dead easy to do.

Ahh ok, I did see that mentioned somewhere when I was researching for a solution...ill look into it and give you an update :)
 

navi95

Registered User.
Local time
Today, 00:32
Joined
Jan 3, 2013
Messages
59

Users who are viewing this thread

Top Bottom