Results 1 to 3 of 3

Extract Month & Year from a date

This is a discussion on Extract Month & Year from a date within the Microsoft Access forums, part of the Question Forums category; i have a field named Date-Datatype is Date and each row contains data 8/2/2007 8:02:00 AM Now in another column ...

  1. #1
    Board Regular
    Join Date
    Dec 2006
    Location
    India
    Posts
    137

    Post Extract Month & Year from a date

    i have a field named Date-Datatype is Date and each row contains data 8/2/2007 8:02:00 AM

    Now in another column i need to extract only the month&year . How can i have records only showing month&year . I need a append query . Please help
    excel excel everywhere

  2. #2
    Board Regular schielrn's Avatar
    Join Date
    Apr 2007
    Location
    Cincinnati, Ohio
    Posts
    6,924

    Default Re: Extract Month & Year from a date

    Can you just use a formula in the column?

    Month: Month(Date)
    Year: Year(Date)

    Its been a while since I have used access, but I believe that is possible.
    Always make a back up copy before trying new code, you never know what you might lose!


    - Posting guidelines, forum rules and terms of use

    -Try searching for your answer first, see how

    - Read the FAQs

    - List of BB codes

    "The world suffers a lot. Not because of the violence of bad people, but because of the silence of good people!"

  3. #3
    MrExcel MVP
    Moderator
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    27,039

    Default Re: Extract Month & Year from a date

    You can use the Format function in a calculated field, i.e.

    Code:
    MyMonthDate: FORMAT([DateField],"mmyyyy")
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com