Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

advanced microsoft access courses in london - cumulative total query

Forum home » Delegate support and help forum » Microsoft Access Training and help » advanced microsoft access courses in london - Cumulative Total Query

advanced microsoft access courses in london - Cumulative Total Query

ResolvedVersion Standard

Caroline has attended:
Excel Advanced course
Excel VBA Intro Intermediate course
Access Intermediate course

Cumulative Total Query

Hi,

I am trying to produce a cumulative total in a query. I am using the DSum function and I can get this to work if I want to compare the ID number and add up totals in this order, but what I really need is to be able to compare dates and add up values in order of the date the action is expected to be completed:

I have three columns in this query - Value (the cost that I want to produce my cumulative total from), the cost ID (the primany key), and the expected cost date (the date the cost is due to come in)

I am hoping to use this query to produce a graph in a report to show how the costs spent over time.

This is the expresion i'm using:

Total Cost: DSum("[Value]","[CostsTable]","[Expected Cost Date] >=" & [InstallTable]![Circuit Expected Live Date])

If I exchange Expected Cost Date with the Cost ID then I can get this to add up, although not in the order I'm hoping to get. But when I use the Expected Cost Date I get blank cells.

Please can you let me know what I am doing wrong with this expresion?

Many thanks,
Caroline

RE: Cumulative Total Query

make sure it is simular to this

"'[Expected Cost Date]'">=

RE: Cumulative Total Query

Hi Garry,
Thank you but I still cannot get an answer from this.. Could you write out the whole formula for me, please?
Thanks!
Caroline

RE: Cumulative Total Query

Hi Caroline,

I think what he meant was, instead of your original:
DSum("[Value]","[CostsTable]","[Expected Cost Date] >=" & [InstallTable]![Circuit Expected Live Date])

Change it to:
DSum("[Value]","[CostsTable]","'[Expected Cost Date]'">= & [InstallTable]![Circuit Expected Live Date])

Your code had the double quote after the greater-than-or-equal-to sign.

He also seems to have added single quotes in between the double quotes and square brackets... that may be important too.

Let us know how you go.

Regards, Rich

Access tip:

Open A Combo Box Automatically

This is helpful if users need to enter large amounts of data. There are two ways to open ComboBoxes when they get the focus by using the tab keys.

When the ComboBox gets focus:

Press Alt + Down Arrow on the keyboard

For it to happen automatically, needs a bit of coding:

1. Add a combo box and a text box control to the form
2. Set the combo box's On Got Focus property to the following event procedure:

Private Sub ComboBoxName _GotFocus()

Me!ComboBoxName.Dropdown

End Sub


3. Open your form in Form View and use the TAB key to make sure it works.

View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.