Results 1 to 2 of 2
  1. #1
    sdel_nevo is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    Gloucester, UK
    Posts
    402

    Dsum data between to dates for this year and last year

    Hi Guys



    i have a form that sums up all the payments from the account transactions table based on an category ID between the dates entered on a form called profit and loss

    the code below is what's used

    =Nz(DSum("[payment]","[Account Transactions]","[category]=1 and [Entry Date] between #" & Format([Forms]![Open Profit And Loss]![Start Date Txt Box],"mm\/dd\/yyyy") & "# And #" & Format([Forms]![Open Profit And Loss]![End Date Txt Box],"mm\/dd\/yyyy") & "#"),0)

    this works really well, many thanks to everyone who has helped me over the last few months

    i would like to be able to show on the same form in a unbound text box exactly the same but for last year, i am not sure how i can enter year(now())-1 into the code above, or even if this is the correct way to go.

    any help would be most gratefully received.

  2. #2
    sdel_nevo is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    Gloucester, UK
    Posts
    402
    god, not sure why i didn't see this earlier

    i just added 2 more date fields to the [Open Profit And Loss] form, that = start date-365 and end date -365 and referenced them in the code.

    Steve

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

Similar Threads

  1. Replies: 2
    Last Post: 02-11-2013, 12:05 PM
  2. Replies: 4
    Last Post: 01-09-2013, 11:16 AM
  3. Replies: 4
    Last Post: 01-10-2012, 06:26 PM
  4. Year over Year Comparision of Portfolio
    By richard70 in forum Queries
    Replies: 2
    Last Post: 10-31-2011, 08:19 PM

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