Hello,
I am working on stock control DB. I have already reached multiple warehouses creation; purchasing; transfer between warehouses.
my problem now is selling item stock deduction. I will show here the query im using
Purchase Query: - SELECT Warehouse.[Warehouse Code],
-
Warehouse.[Warehouse Description 1],
-
Item.[Item Code],
-
Item.[Item Description 1],
-
Sum([Purchase Item].[Stock Quantity]) +
-
Nz((SELECT SUM(QuantityTransferred)
-
FROM Transfers
-
WHERE Transfers.ItemCode = [Item].[Item Code]
-
AND Transfers.WarehouseCode = [Warehouse].[Warehouse Code]),0)
-
AS [Stock Quantity],
-
[Purchase Item].[Sum Stock Quantity]
-
FROM Warehouse
-
INNER JOIN ([Purchase Invoice]
-
INNER JOIN (Item INNER JOIN [Purchase Item]
-
ON Item.[Item Code] = [Purchase Item].[Item Code])
-
ON [Purchase Invoice].[Purchase Number] = [Purchase Item].[Purchase Invoice Code])
-
ON Warehouse.[Warehouse Code] = [Purchase Item].[P Warehouse Code]
-
GROUP BY Warehouse.[Warehouse Code],
-
Warehouse.[Warehouse Description 1],
-
Item.[Item Code],
-
Item.[Item Description 1],
-
[Purchase Item].[Sum Stock Quantity];
Selling Query: - SELECT Warehouse.[Warehouse Code],
-
Warehouse.[Warehouse Description 1],
-
Item.[Item Code],
-
Item.[Item Description 1],
-
[Sales Item].[Sales Stock Quantity]
-
FROM Item
-
INNER JOIN (Warehouse
-
INNER JOIN ([Sales Invoice]
-
INNER JOIN [Sales Item]
-
ON [Sales Invoice].[Sales Number] = [Sales Item].[Sales Invoice Code])
-
ON Warehouse.[Warehouse Code] = [Sales Item].[S Warehouse Code])
-
ON Item.[Item Code] = [Sales Item].[Item Code]
-
GROUP BY Warehouse.[Warehouse Code],
-
Warehouse.[Warehouse Description 1],
-
Item.[Item Code],
-
Item.[Item Description 1],
-
[Sales Item].[Sales Stock Quantity];
The problem is in deduction
I just want Purchases-Sales
please take a look at my db in the following link
(Link removed - please read posting instructions carefully).
4 1341 Luuk 1,047
Expert 1GB - SELECT
-
Item.[Item Code],
-
Item.[Item Description 1],
-
P.PurchasedQuantity - S.SoldQuantity
-
FROM (purchasesquery) P
-
OUTER JOIN (salesquery) S ON S.Item.[Item Code] = P.Item.[Item Code]
-
For the fields 'PurchasedQuantity' and 'SoldQuantity' you can/should add aliases to the queries.
In place of 'purchasesquery' you could have the name of a view, which is defined as your query which returns purchases.
Luuk please check out the db on the following link
Luuk 1,047
Expert 1GB
I do not see a (working) link in your mail.
I do not have MS-Access, so I cannot test anything for you.
gcreed,
Your DB link has been removed, as it violated site policies. Posters should not simply post their DB to our forum unless specifically asked by a site moderator/expert.
Additionally, you have not offered any true effort in resolving this issue yourself--merely asking others to do the heavy-lifting for you. This is typically not how this forum works. If you would like specific help on a query or data manipulation problem that does not work, we ask you to post the work you have done so far and explain what about it that does not work.
Or, we can offer assistance by providing direction for how you might approach a particular challenge. In your case, what you are seeking to do is find out how many items were purchased and deduct that from the table that holds your current inventory. In theory, that is the solution, but I realize that you want to know how to do that. Most of us will not do this work for you, as we all have jobs that pay the bills, and Bytes is not one of those income producing activities.
I hope you understand.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: signaturefactory |
last post by:
I am trying the following query in and oleDbCommand:
SELECT PartLocations.LocationName, Sum(PartsJournal.Quantity) AS
SumOfQuantity, PartsJournal.PartsLotNumber
FROM PartLocations INNER JOIN...
|
by: Dalan |
last post by:
I have attempted to resolve a problem regarding erroneous output using
a Between And parameter on several
Access 97 queries, but to no avail. The queries are used for report
output and...
|
by: Justin |
last post by:
We currently have a solution to this coded in VBA in Excel, but the
255 column limitation, general slowness, and instability of Excel are
rapidly becoming problems. Access has been suggested as a...
|
by: Malin |
last post by:
Hi everybody
I have an asp.net application with vb.net codebehind. In the web.config
the following settings are set for session state handling:
<sessionState
mode="InProc"...
|
by: Wired Hosting News |
last post by:
Lets say I have 10 products in 10 different stores and every week I get a
report from each store telling me how many items they have left for each of
the 10 products.
So each week I enter in 100...
|
by: Wired Hosting News |
last post by:
I tried to be breif and give a scenario so as not to be overlooked because
it was soooo long. Let me give you real world.
I am a manufacturer of goods and produce 11 items that are distributed...
|
by: HangEveryRepubliKKKan |
last post by:
Ahahahaha.. Lets see if I get this Demented Lintard reasoning right.
Vista is a failure becuase after 300 days after it's release, it only has
7.5% of the OS market while the Lintard OS, is a...
|
by: Reggraw |
last post by:
My program is supposed to output a list of users who input their sales name along with their sales amount and then print out a display. I am using a nested for loop to read through the list of...
|
by: Jabari Powell |
last post by:
Okay, so I'm back with another conundrum I hope you all can help me with.
I am trying to generate a random number of units sold (for a single sale) that is equal to a randomly generated...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |