Solved Stock Summary Issue in crosstab query

ahmad_rmh

Member
Local time
Today, 15:30
Joined
Jun 26, 2022
Messages
243
I am making a stock summary in crosstab query. The criteria is as under;

1. Current Stock should have to be the net present stock, i.e, (Opening+Purchases-Transfers)

2. Branches stock should have to be only current month transfers.

how to get this.

db file is attached herewith.

kindly suggest
 

Attachments

Your query is producing a result, so I can't see what the issue is. But I do know what will help--show me what results you expect.

Run your query, paste the results into Excel then change the ones that are incorrect and post that file back here. That will allow me to see what you expect it to return and help you get there.
 
Your query is producing a result, so I can't see what the issue is. But I do know what will help--show me what results you expect.

Run your query, paste the results into Excel then change the ones that are incorrect and post that file back here. That will allow me to see what you expect it to return and help you get there.

Yes, Current stock result is ok, but the branches transfers should have to be shown only current month transfers but it's including the previous month transfers.
 
You quoted my post which leads me to believe you read it, but didn't provide what I requested.
 
You're not helping me help you. I need to see what data you are starting with and what data you expect to end up with. Trying to walk me through it isn't helpful. I need you to do less work than you actually are.

Give me a database with sample data, then based on that data give me what you expect the query you are building to look like. No words needed, not step by step instructions, just data--starting and expected results based on starting data.
 
You're not helping me help you. I need to see what data you are starting with and what data you expect to end up with. Trying to walk me through it isn't helpful. I need you to do less work than you actually are.

Give me a database with sample data, then based on that data give me what you expect the query you are building to look like. No words needed, not step by step instructions, just data--starting and expected results based on starting data.

ok, got it,
1. sample db file is attahced herewith.
2. pdf is attached for the expected results.
 

Attachments

That's perfect. Since you want calculations based on different timeframes (all and current month) it will require some subqueries. I've attached a database that gets you 95% of the way there. Here's what each query does:

sub1 - gets total stock for each item

sub2 - gets total current month transactions for each item and branch. This will automatically update to the current month each month. Which also means if you want January totals in February you will need to make an adjustment in this query.

sub3 - combines them together

To get your finished product you would make another query based on sub3 and cross tab it.
 

Attachments

That's perfect. Since you want calculations based on different timeframes (all and current month) it will require some subqueries. I've attached a database that gets you 95% of the way there. Here's what each query does:

sub1 - gets total stock for each item

sub2 - gets total current month transactions for each item and branch. This will automatically update to the current month each month. Which also means if you want January totals in February you will need to make an adjustment in this query.

sub3 - combines them together

To get your finished product you would make another query based on sub3 and cross tab it.

Thanks plog, done,
 

Users who are viewing this thread

Back
Top Bottom