Results 1 to 4 of 4

Thread: Syntax for DSum

  1. #1
    Join Date
    Mar 2009
    Posts
    120

    Unanswered: Syntax for DSum

    Hopeing someone can assist me with this, or maybe its not even the correct option for what i am trying to accomplish.

    I have a payroll db with all of our payroll information in it.

    I need to total Dollars based on our Pay codes into two seperat buckets.
    1st is Annual Compensation, 2nd is Allowances.

    I am having trouble with the function, not sure what to put where or how to do it in the query.

    Both totals are based off of the Pay Code filed in the Payroll Data table.

    Basicall if the Pay Code = 1 of 18 different numbers it would Total the dollars as Compansation adn in a 2nd field if the Pay COde = 2 different numbers it would total the dollars as "allowance".

    I tried to do Allowance: DSum( but here is where I am not sure)

    Thank you for any assistance.

  2. #2
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,424
    Provided Answers: 8
    Sum it in SQL query dsum() will slow the system down

    You need to groupby [paycode] and sum the allowance

    To make it beater

    Groupby [empid],[paycode] and sum the allowance
    This will group all the empid and group all the paycodes and sum the allowance
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  3. #3
    Join Date
    Mar 2009
    Posts
    120
    Quote Originally Posted by myle View Post
    Sum it in SQL query dsum() will slow the system down

    You need to groupby [paycode] and sum the allowance

    To make it beater

    Groupby [empid],[paycode] and sum the allowance
    This will group all the empid and group all the paycodes and sum the allowance
    I don't think this will work for what I need. I need both the Allowance and the Compensation on the same row along with the Emp ID and Name etc.

    That is my issue, I can't get them to sum in seperate columns but on the same row.

  4. #4
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,424
    Provided Answers: 8
    Can you attach some data
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •