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

    only show this years results

    Hi Guys

    i have this query that creates a chart this works great and returns the total "issuesclosed" by month



    SELECT (Format([IssueClosed],"mmm"" '""yy")) AS Expr1, Count(IssuesByAssetNameChart.NoteType) AS CountOfNoteType
    FROM IssuesByAssetNameChart
    GROUP BY (Format([IssueClosed],"mmm"" '""yy")), (Year([IssueClosed])*12+Month([IssueClosed])-1)
    ORDER BY (Year([IssueClosed])*12+Month([IssueClosed])-1);


    what i want to do is only show the current year, at the moment its showing all the months and years so for example i only want to show 2014's results and at the start of 2015 the chart will be blank

    any ideas?

  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,652
    If you really mean the current year, add the bit in red:

    SELECT (Format([IssueClosed],"mmm"" '""yy")) AS Expr1, Count(IssuesByAssetNameChart.NoteType) AS CountOfNoteType
    FROM IssuesByAssetNameChart
    WHERE Year(IssueClosed) = Year(Date())
    GROUP BY (Format([IssueClosed],"mmm"" '""yy")), (Year([IssueClosed])*12+Month([IssueClosed])-1)
    ORDER BY (Year([IssueClosed])*12+Month([IssueClosed])-1);
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    sdel_nevo is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    Gloucester, UK
    Posts
    402
    Hip baldy
    Many thanks for the speedy reply I will update the query when I'm back in the office first thing in the morning

    Many many thanks
    Steve

  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,652
    No problem Steve.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    sdel_nevo is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    Gloucester, UK
    Posts
    402
    Hi pbaldy

    that worked really well, many many thanks

    Steve

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

Similar Threads

  1. Query that show certain results
    By LukeJ Innov in forum Queries
    Replies: 3
    Last Post: 09-03-2013, 03:26 AM
  2. IIf statement to show all results
    By nigelbloomy in forum Queries
    Replies: 5
    Last Post: 07-22-2013, 02:00 PM
  3. Replies: 6
    Last Post: 05-14-2012, 07:24 AM
  4. Replies: 5
    Last Post: 07-04-2011, 10:11 AM
  5. Replies: 1
    Last Post: 03-15-2007, 03:38 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