Microsoft
Software
Hardware
Network
Question : Create a running total in a query
I have a TableA with the field Total. TableA only has one entry under Total. I also TableB with the field actual. Table B has numerous entries under the field actual.
I want to create a query that will list each entry in Table B in one column and in the second column a decreasing total (Total from TableA - Entry in TableB).
Answer : Create a running total in a query
Hi lashler2,
If I have understood your post correctly I am not sure if this can be done in a query. If I am right you have the following:
Table A = 1 row of data with a value in the total field (1000 for example)
Table B = multiple rows with smaller values in the Actual filed
In your output you want to see a remaining value from the Total based on the cumulative values in the Actual Fileds
i.e.
Total Actual Remaining
1000 10 990
1000 100 890
1000 50 840
etc...
(Sorry if the layout is poor!)
If this is the case then I do not know of a way to accomplish this in a query.
You could try to cheat using a report if that might suffice.
In a report you could display the Total value in one field and the Actual value in another. You can then set the properties of the Actual value to be a "Running Sum" which should display the running total of the actual values. Then add another text box and set the control for this to be [Total]-[Running Sum Of Actual]
This might then display the information you are after.
Please note, there is probably a much better way to do this so just hang in there for a while to see if any of the experts can come up with something for you.
Hope this helps,
Mark.
Random Solutions
Working with recordsets
STOP: 0x00000007B (0xF7B44528, 0xC0000034, 0x00000000, 0x00000000)
Defining anamed range dunamically
Modifying tableadapter parameters
Exchange 2003 Cluster, Event ID: 1080 occurs every three seconds
Combine data from two separate tables.fields into one Query field
sortable table in Mac Excel
Small business server 2008 unable to add user with console
Missing ; at end of SQL statement
How can I install a Third Party certificate within IE7 on Terminal Server for all users