Results 1 to 6 of 6
  1. #1
    objNoob is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    21

    Help with Sum and DSum

    I'm trying to make a daily report where I place the SUM for only that day next to the complete total SUM of all previous days (a running total).

    I'm just not sure how I can selectively SUM for that day. I tried using =DSum but I get #Error all the way down my report. I do not know what to use for the domain. Do I use the same query I used in report wizard?
    Last edited by objNoob; 03-22-2010 at 07:47 AM.

  2. #2
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    Let me get you Straight You want to display all totals of a field for all dates before the selected date and sum of that particular Field for a selected date.

    My Sample mdb Contains:
    Table8:{Sales_id(Autonumber PK),S_Date,Item, Amount}
    Form:Open With a Text Box to Type a Particular Date,Command Button To open Report Table8
    Report Table8: Has Three Text Boxes in the Report Footer and they Diplay following Info:
    1) Total Of Amount Before Selected Date
    2) Total of Amount for the Selected date
    3) Total of Amount after the Selected Date


    I have used DSum to achieve this result.Please Look into the expressions in the Reports text boxes.Type dates in the form and see the Results in the report.

    Mark this Thread solved if this solves you problem.

  3. #3
    objNoob is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    21
    The goal is to all list projects with time spent on the project for a particular day, and any time spent on that project up to that date.

    I'm looking at your example this morning, and I've toyed around with DSum last night for a bit. I believe it's the solution. Your example is applied to a very simple task. Somehow, I need to tie the the =DSum control to the current report detail so it will only aggergate hours for that specific project, and filter with a date.

    DSum("[Project Hours]","qryProjectHours","project=[Current_Project_Listed_In_Detail] And DateHours=CDate(txtBox)")

    I'm thinking something along those lines. Now, how would I reference the current detail's project ID control in my DSum? By name?

  4. #4
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    The problem is you should have mentioned the level of complexity in the first post itself and I would have certainly applied it on to the complex task of yours. This example was meant to make you understand the scope of Dsum and how it can be used. It will be really helpful if you will give me details of you tables. The best thing to for you to do is zip your database and upload it in Acces 2000 format.

  5. #5
    objNoob is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    21
    I was able to apply it to the specific detail. And it Sums the hours per project for a given date next to the running sum!

    Your example was fine. Thanks Max.

    I decided to switch logic. I'm going to base the report off of a single day query, and use DSum to aggergate all running total values. This way I can sort by daily values on a daily report. Seems to make more sense.

  6. #6
    Nasserhj is offline Novice
    Windows XP Access 2003
    Join Date
    Dec 2011
    Posts
    2
    Thank you for help

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 13
    Last Post: 12-05-2011, 05:10 AM
  2. Help with dsum
    By bjsbrown in forum Reports
    Replies: 6
    Last Post: 02-06-2010, 09:33 AM
  3. DSUM HELP needed
    By jjmartinson in forum Access
    Replies: 0
    Last Post: 07-21-2009, 01:47 PM
  4. DSUM HELP! I am frustrated
    By PnerraD in forum Reports
    Replies: 2
    Last Post: 09-24-2007, 02:23 PM
  5. DSUM Problems
    By swampdonkey in forum Forms
    Replies: 2
    Last Post: 09-29-2006, 10:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums