Results 1 to 5 of 5
  1. #1
    Canadiangal is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2009
    Posts
    81

    Date Field to Month Field

    I have a field in Access called Date. I have a query attached to a form that allows the end user to enter data. Right now they enter the Date field, and then they have another field called month which they fill in manually. So 12/5/1963 would be in the Date Field, and the Month Field would be 12. What calculation can I put in that would copy the Month from the Date field and put it into the Month Field.

  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,521
    For starters, date is a bad field name as Access can confuse it with the Date() function. Why would you save the month when it is so easily derived from the date field? I wouldn't save it, but the Month() function would be used either way.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383

    Date Syntax

    What is the format of your date field (s)? short date? And, do you want a numeric value such as 01 or January? for the end result?

    I used Text0 and Text4 for my date fields with Text0 being the date field the user enters a date into. with the format being short date and Text4 having NO format and its default value set to: =DatePart("m",[Text0]) and this gives you the month in numeric value. Hope this helps, unsure if what exactly you want!???
    Last edited by burrina; 03-09-2013 at 01:01 AM. Reason: Code

  4. #4
    Canadiangal is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2009
    Posts
    81
    Thanks Paul, that did the trick. The month field is used on another query.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 3
    Last Post: 04-01-2012, 01:40 PM
  2. Replies: 2
    Last Post: 03-31-2012, 07:53 AM
  3. Replies: 5
    Last Post: 11-15-2010, 06:12 PM
  4. Replies: 1
    Last Post: 11-13-2010, 12:57 PM
  5. Replies: 10
    Last Post: 04-21-2010, 01:16 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