Count down please HELP

Jaharul

New Member
Joined
Jul 14, 2004
Messages
34
Hi All

I want to subtract a rolling form which is updated daily against a budgeted figure but i jus cant get it to work please help. Its basically like a stock system when an item is sold the quantity in stock is reduced.

Many thanks to the helper. :rolleyes: :rolleyes: :rolleyes: :rolleyes: :biggrin:
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
OK, in the design view of the query, where you have the grid,
go View>SQL View and you will get the text that makes up your query. Copy this and just paste it.

Peter
 
Upvote 0
SELECT [Rolling Travel 2004].Destination, [Travel Matrix].[# of Trips], [Travel Matrix].[# of People on Trip(s)], [Travel Matrix].[# Total trips], [Travel Matrix].F10, Count([Rolling Travel 2004].[Date of Dep]) AS [CountOfDate of Dep]
FROM [Rolling Travel 2004] LEFT JOIN [Travel Matrix] ON [Rolling Travel 2004].Destination = [Travel Matrix].F10
GROUP BY [Rolling Travel 2004].Destination, [Travel Matrix].[# of Trips], [Travel Matrix].[# of People on Trip(s)], [Travel Matrix].[# Total trips], [Travel Matrix].F10;

Thats the SQL view
 
Upvote 0
try this and see if it does what you want

SELECT [Rolling Travel 2004].Destination, [Travel Matrix].[# of Trips], [Travel Matrix].[# of People on Trip(s)], [Travel Matrix].[# Total trips], [Travel Matrix].F10, Count([Rolling Travel 2004].[Date of Dep]) AS [CountOfDate of Dep], [# Total trips]-[CountOfDate of Dep] AS Balance
FROM [Rolling Travel 2004] LEFT JOIN [Travel Matrix] ON [Rolling Travel 2004].Destination = [Travel Matrix].F10
GROUP BY [Rolling Travel 2004].Destination, [Travel Matrix].[# of Trips], [Travel Matrix].[# of People on Trip(s)], [Travel Matrix].[# Total trips], [Travel Matrix].F10;


Peter
 
Upvote 0
Thanks alot mate it seems to be workin but now i have a problem with the count of dep date it seems to be counting the figure wrong
 
Upvote 0
The value of count will be the number of records in each group as defined by your grouped field. Do you actualy need all of the fields that you are grouping on in there? In what way is the count wrong?

Peter
 
Upvote 0
the count is fine but it seems that a country like ukraine for example showing up about 5 different times which in some places causes the count to be over stated.
 
Upvote 0
the query looks ok. I would check your data, are either of the two tables in the query actualy other queris? if so double check the data in them to make sure they are not doubling up somehow.

Peter
 
Upvote 0

Forum statistics

Threads
1,221,813
Messages
6,162,117
Members
451,743
Latest member
matt3388

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