Calculated Field Creating Duplicate entries in MSQuery? Any solutions?

Aero12

New Member
Joined
Dec 24, 2015
Messages
3
Hi everyone, having a problem with a query I'm designing.

I am working off a inventory database that our system software contains. Here are the columns:

Item number
Description
Current Stock
Quantity on Order
Order Point Quantity

Everything is working well with these. The item numbers come up, as well as their description, current stock level, the quantity we have on order of each part, and the order point quantity, which I can set to whatever value I want.

Here is where the problem comes in. I have written the following code into another field:

IIF((IC_ITWH.EOQ_QTY-(IIF(IC_ITWH.QTY_OHND Is Null,+0,IC_ITWH.QTY_OHND)+IC_ITWH.QTY_OORD))>0,'REORDER',Null)

It does work. Basically if the end user quantity that I set, minus the sum of amount on hand plus the amount on order, is greater than zero, "Reorder" is displayed. If not, then no entry is made.

The problem I'm having is that the ones that show "Reorder" duplicate the entry on the query, and I know why it is happening. We have 2 warehouses in house, "new" and "old". There's another field called "warehouse number" that I left out of the query so that the parts will hopefully sum together without separating out between the new and old. For some reason, if an item number contains a record of both the "new" and "old" warehouse, a duplicate entry is listed in the query results. How do I combine the two warehouse totals so that the query calculates based off the total sum, without creating a separate entry for both warehouse? It's weird that this only happens on a calculated field. Just listing the part numbers by themselves does not generate this issue.

Really hoping someone can help. Thank you very much,
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Forum statistics

Threads
1,224,516
Messages
6,179,231
Members
452,898
Latest member
Capolavoro009

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