Full Version: Descending Total
UtterAccess Discussion Forums > Microsoft® Access > Access Reports
TheForce
Hi all.

I have a report to show employee holidays. I have a field for total number of holidays allowed for the year (remains constant for the year), and another for how many days are to be taken with each holiday request.

My question is, how do I go about having a "descending sum" on the report showing total days minus days taken for each line on the report, ie each holiday request?

Hope that makes sense.

Thank you smile.gif

Keith.
Jerry Whittle
Create a calculated control field either in the query used for the report or on the report.. Something like [Holidays]-[Taken] .

Next go to the reports Sorting and Grouping options and sort on this calculated control.
TheForce
Thanks very much for your reply Jerry. The report is already sorted in "start date" order, what I was trying to also display is a "remainder" figure at the end of each row, something like:

01/01/2011 to 01/03/2011, dur'n 3, rem 22.
01/12/2011 to 01/12/2011, dur'n 1, rem 21.
02/08/2011 to 02/11/2011, durn 4, rem 16.

Sorry for the lousy explanation wink.gif

Keith.
Roger_Carlson
Reports have a "Running Sum" feature (there's a step-by-step here: http://office.microsoft.com/en-us/access-h...005187388.aspx). Adding the negative of your duration will create a running difference.
TheForce
Thanks Roger, I'd already tried Running Sum, I think I'm not following you at all I'm afraid. If I add the negative isn't that the same as just subtracting?

Thanks for your patience iconfused.gif
Roger_Carlson
Perhaps I'm the one misunderstanding. Don't you want to subtract 1 from 22 to get 21 (in the sample above)?
TheForce
Yeh that is what I want Roger, perhaps I'm not using the running sum feature correctly. I'll persevere with it, many thanks for your time smile.gif
TheForce
OK what I ended up doing was having a text box with a running sum on "days taken" and a *second* text box with a control source of [txtTotalHols] - [txtDaysTaken] (the contents of one text box minus another). Is that what you was suggesting? Thanks again for your patience smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.