Results 1 to 4 of 4
  1. #1
    rkalapura is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Location
    New York
    Posts
    69

    Dsum() function

    Hai,

    Can anybody help me on the following DSum() function in Access2010? Appreciate to correct me where I am wrong.

    DSum("[hourstaken]","[VACATION]","[EMPLOYEEID]=" & [Forms]![Vacation]![EmployeeID] And " Year([DateTaken])=" &[Forms]![Vacation]![YearSelect])



    It gives the sum with the first criteria but not with the second one and when combined. I am trying to extract the year from the [DateTaken] date field and match with the [YearSelect] Combobox.

    Thank you in advance

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Try

    DSum("[hourstaken]","[VACATION]","[EMPLOYEEID]=" & [Forms]![Vacation]![EmployeeID] & " And Year([DateTaken])=" &[Forms]![Vacation]![YearSelect])
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    rkalapura is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Location
    New York
    Posts
    69
    Quote Originally Posted by pbaldy View Post
    Try

    DSum("[hourstaken]","[VACATION]","[EMPLOYEEID]=" & [Forms]![Vacation]![EmployeeID] & " And Year([DateTaken])=" &[Forms]![Vacation]![YearSelect])

    Thank your very much. It works fine

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Happy to help.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Problem in Query and DSUM function
    By simplefahad2005 in forum Access
    Replies: 3
    Last Post: 07-27-2012, 12:46 AM
  2. Dsum Help?
    By Ragin_roider in forum Queries
    Replies: 5
    Last Post: 03-19-2012, 03:10 PM
  3. Help with Sum and DSum
    By objNoob in forum Reports
    Replies: 5
    Last Post: 12-05-2011, 01:55 AM
  4. How do I use the DSum
    By Ironclaw in forum Access
    Replies: 1
    Last Post: 08-25-2010, 07:35 AM
  5. Help with dsum
    By bjsbrown in forum Reports
    Replies: 6
    Last Post: 02-06-2010, 09:33 AM

Tags for this Thread

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