How to Avoid, repetition in one filed of Access Query...

danireh

New Member
Joined
Feb 14, 2016
Messages
5
Hi All, I am kind of stuck on finalize a crucial report in MS Access..... and tried to Google it as well but didn’t find any useful solution....
I will try to explain it with an example...


Lets Say i have a Table in Access with below data:
Table 1:
Material
Description
Qty
A
AXYZ
5
B
BXYZ
10

<tbody>
</tbody>

and its linked with below table of deliveries... with Field "Material"

Delivery
Material
Delivered Qty
Del100
A
2
Del100
B
8
Del200
A
2
Del200
B
6

<tbody>
</tbody>

Now while creating a query on both tables with Ordered qty and Delivered Qty, results are displayed as below...


Material
Delivery
Order Qty
Delivered Qty
A
Del100
5
2
A
Del200
5
2
B
Del100
10
2
B
Del200
10
6

<tbody>
</tbody>

i want to avoid repetition in Order Qty column in final output as it gives a wrong image of order qty to be double or multiples of No. of Deliveries.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
That is because you have a one-to-many relationship between your two tables if you are just joining on the Material field.

So, the question is, what do you want your output to look like? Note that each material has two different Delivery values. So if you only want to see one, record, which Delivery value do you want to see?
 
Upvote 0
Hi Joe,

I need my query to display to show order quantity only once, with all the other fields in tact. current result is displaying an order quantity with each delivery information which can lead to misunderstanding of q

MaterialDeliveryOrder QtyDelivered Qty
ADel10052
ADel20052
BDel100102
BDel200106

<tbody>
</tbody>
 
Upvote 0
Hi Joe,
posted by mistake without completion....

I need my query to display to show order quantity only once, with all the other fields in tact. current result is displaying an order quantity with each delivery information which can lead to misunderstanding of doubled Order qty.... the tables are joined in query with the field "Material" ...

MaterialDeliveryOrder QtyDelivered Qty
ADel10052
ADel2002
BDel100102
BDel2006

<tbody>
</tbody>

Hope that would help to understand the issues...
 
Upvote 0
Hmmm...

If you wanted to show something like that, you would probably need to do more of a Report than a Query, where you can incorporate some VBA code that looks at the previous record's results. You really cannot do that easily with a query (I am not even sure how you would do it with a query).

Or you could use VBA and loop through the recordset and write the results back to a new table...
 
Upvote 0

Forum statistics

Threads
1,214,791
Messages
6,121,611
Members
449,038
Latest member
apwr

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top