Results 1 to 2 of 2
  1. #1
    tngirl is offline Novice
    Windows XP Access 2003
    Join Date
    May 2013
    Posts
    20

    Query Expression for Month Names

    I have been asked to create a report that will show data for each month of the year. The date field in the table that houses the data is called "Date". How would I write the expression in the query for the field name and criteria. If you help me with January, I can do the other months. Thanks so much for your help.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Date is a reserved word. Should avoid reserved words as names.

    Build an aggregate (GROUP BY) Totals query that summarizes by year and month. Or build a report using Grouping & Sorting functionality with summary calcs in footers.

    Extract the year and month with expressions that create fields in query:

    Format([Date], "yyyymmm")

    Month([Date])

    Year([Date])

    Apply filter criteria to the constructed fields like any other field. Use the fields in aggregate query or in report to create grouping.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 4
    Last Post: 05-26-2013, 03:28 PM
  2. Replies: 2
    Last Post: 11-20-2012, 03:21 AM
  3. Replies: 4
    Last Post: 10-26-2012, 12:49 AM
  4. Query Entity Names, and Column Names
    By Accidental DBA in forum Queries
    Replies: 1
    Last Post: 07-22-2011, 02:38 PM
  5. Replies: 5
    Last Post: 04-24-2011, 03:14 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