Results 1 to 2 of 2
  1. #1
    Ironclaw is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1

    Question How do I use the DSum

    I am trying to setup a database that records Employee Leave, I have Two tables, one EMPLOYEES and EMPLOYEE LEAVE. In EMPLOYEE LEAVE, I have used the EMPLOYEE names and EMPLOYEE ID from the EMPLOYEE table as the Primary key. The problem is this, I have so far managed to get the data in the Form to calculate how many month leave an employee has accrued till the current date, but need a way to add the total days leave they have taken so far in the TOTAL DAYS TAKEN field that is in the EMPLOYEE LEAVE table and only add the TOTAL DAYS LEAVE for each individual Employee per record at any given date. I intend to use this value to subtract TOTAL LEAVE TAKEN from another field LEAVE LEFT which will them give a value for TOTAL LEAVE AVAILABLE.

    I am relatively new to this, so please assist where possible.

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    Remove the field [TOTAL DAYS LEAVE] because it is not up to date until you run query to update it. You can use query to get it whenever you need.

    Use query below to achieve what you want:

    select a.[employee id], a.[employee name], a.[TOTAL DAYS TAKEN ], sum(b.[employee leave] as [total leave taken] from employees as a inner join [employee leave] as b on a.[employee id]=b.[employee id] group by a.[employee id],a.[employee name]

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

Similar Threads

  1. Help with Sum and DSum
    By objNoob in forum Reports
    Replies: 5
    Last Post: 12-05-2011, 01:55 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