Results 1 to 2 of 2
  1. #1
    maxmaggot is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Location
    Ireland
    Posts
    91

    DSUM with DLOOKUP

    I've been trying to remove the need for a query to calcuate a sum for me and I;ve had a go with DSUM. I'm getting a #Type error. I'm trying to get the yeat to date total for an amount. Here is the code I've written.



    =DSum("[Amount]","[Donations]") & DLookUp(DatePart("yyyy","[DatePaid]"),"[Donations]",DatePart("yyyy",Date()))

    I've also tried

    =DSum("[Amount]","[Donations]"), "Don_Amount=" & DLookUp(DatePart("yyyy",[DatePaid]),[Donations],DatePart("yyyy",Date())

    Thanks for your time

  2. #2
    maxmaggot is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Location
    Ireland
    Posts
    91
    Got it with
    =DSum("[Amount]","Donations","[DatePaid] BETWEEN #" & DateSerial(Year(Date()),1,1) & "# AND #" & Date() & "#")

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

Similar Threads

  1. Dsum Help?
    By Ragin_roider in forum Queries
    Replies: 5
    Last Post: 03-19-2012, 03:10 PM
  2. DSum ! I jumped the Gun
    By libraccess in forum Queries
    Replies: 8
    Last Post: 03-06-2012, 09:51 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