Results 1 to 4 of 4
  1. #1
    Kirsti is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Jan 2012
    Location
    New Zealand
    Posts
    172

    YTD Problem

    Hi, I have reports that show data for the previous month, and then the same data in a YTD view. The calculation for YTD is: Year([Field1]) = Year Now())



    However, actually - I only want to show data from the start of the year until the end of the previous month, so no current month data is included.

    The only way I know how to do this is using Between Date and hardcoding '2012', but I don't want to do this for obvious reasons. Is there another way of doing this?

    Thanks in advance,

    Kirsti

  2. #2
    manic is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Posts
    63
    Can you give me an example using actual dates?

  3. #3
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    You could try:
    Code:
    ..... WHERE Year([Field1]) = Year( Now()) AND MONTH([Field1]) < MONTH( Now())

  4. #4
    Kirsti is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Jan 2012
    Location
    New Zealand
    Posts
    172
    Thank you - that's exactly what I wanted.

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

Similar Threads

  1. Replies: 2
    Last Post: 06-14-2010, 03:25 PM
  2. query problem i have a problem wi
    By maxx3 in forum Queries
    Replies: 0
    Last Post: 06-29-2009, 02:29 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