Results 1 to 4 of 4
  1. #1
    Dormie is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2014
    Posts
    39

    Adding Column with Month & Year

    Hi, I was hoping for some help on the formula to add month and year.

    I've used both in the past. Looking for the month and year in the same column.
    Month: Month([date])


    Year: Year([date])

    Thank you.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,451
    something like

    year([date]) *100+month([date]) for a numerical value

    or

    format([date],"yyyymm") for a text value

  3. #3
    Dormie is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2014
    Posts
    39
    Great Thank you Ajax,

    Both worked, Not sure which one I'll use. I thought in a previous palying around database, I had a code that displayed Jan-2016, for months.

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,451
    you can do that

    format([date],"mmm-yyyy")

    but you won't be able to sort it by months (Feb will come before Jan), you'll need an extra column to do that based on a numerical month.

    Bty the way, youa re aware that date is a reserved word (it means today) so using it as a field name will cause problems at some point, so better to change it to something else

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

Similar Threads

  1. Replies: 4
    Last Post: 07-13-2015, 02:06 PM
  2. Replies: 5
    Last Post: 08-26-2014, 06:07 AM
  3. age and day - month - year
    By azhar2006 in forum Access
    Replies: 4
    Last Post: 08-21-2014, 08:30 AM
  4. Replies: 4
    Last Post: 05-26-2013, 03:28 PM
  5. how to extract month and year from date column
    By penguinwebsoft in forum Queries
    Replies: 5
    Last Post: 10-11-2012, 11:29 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