Results 1 to 6 of 6
  1. #1
    nashr1928 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    146

    Calc fields


    I am running access 2003 and have added a filed on a form that calculates total income using =Sum([name]) and this works perfect but I would like to just sum for that column for a certain year like all of 2010. What could I add to that field to do this?

  2. #2
    Rixxe is offline Blessed Bear
    Windows 7 Access 2007
    Join Date
    Sep 2010
    Location
    London (Essex ... yep!)
    Posts
    184
    Add a WHERE clause?
    Where DateField = '2009*'

    Or something of that nature?

    Good luck.

  3. #3
    nashr1928 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    146

    calc fields

    This may be to simple. I have found that its just easiest to highlight the date on the form for the date I want and just use filter by selection. It works perfect. Thanks for your reply.

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    FYI, if you want to sum with a criteria while displaying all, this type of thing should work:

    =Sum(IIf(Year(DateField) = 2010, AmountField, 0))
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    nashr1928 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    146

    calc fields

    Thanks so much for your reply and suggestion.

  6. #6
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682
    If the year is going to change, you could also add an unbound combobox to select the year (make it a value list and values = 2009;2010;2011;2012;etc....) Then add critieria to your existing code to sum where the year matches what is selected.

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

Similar Threads

  1. Combine two fields, Null fields involved
    By yes sir in forum Access
    Replies: 9
    Last Post: 10-03-2010, 09:20 AM
  2. Replies: 5
    Last Post: 03-20-2010, 08:30 AM
  3. Replies: 3
    Last Post: 08-10-2009, 08:33 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