Results 1 to 6 of 6
  1. #1
    Fuzz_cozens is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    25

    Update Query: Convert numeric month to only relfect Month name

    Morning Experts,



    I import an excel file weekly into my DB and would like to use an update query to update 2 columns in the Table [Policy Information]. The 2 columns in the excel I import are called [Policy Month] and [Policy Year]

    Ecxel Table is called Extract
    DB Table to Update is called Policy Information

    These 2 columns are displayed as follows:

    Policy Month: 6
    Policy Year: 2014

    All I would like to do is to update this to "1 June". The policy year is fine as is however I would like to join these 2 columns into a new column for the end result of "1 June 2014"

    I have tried DatePart("m",[production month]) and Dateserial without luck as these only return values of Jan or Dec.

    I am using Access 2010 and Win 8

    Thanks in advance

    Richard

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    In an expression in a new column Policy Date: 1 & " " & DatePart("m",[production month]) & " " & [Policy Year]

  3. #3
    Fuzz_cozens is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    25

    Update Query: Convert numeric month to only relfect Month name

    Thanks pal. Will try quickly

  4. #4
    Fuzz_cozens is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    25
    Thanks Alansidman

    I used the expression you gave and the result is reflecting "11 2013" which is obviously for November 2013.

    There are 2 hassles here:

    Firstly it is reflecting 11 for the month for all 28,000 records and obviously there are a lot of records with different months of the year.
    Secondly, I would like the word "November" to be used and not the numerical 11

    If I look at the table properties of the extract file the 2 fields [Production month] & [Policy Year] are both in data format number and general Number format. What format should these 2 fileds be. I would think date (med) Any ideas

    Rich

  5. #5
    lfpm062010 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Location
    US
    Posts
    415
    To show the full month name use this,

    Policy Date: "1 " & Monthname([production month]) & " " & [Policy Year]

  6. #6
    Fuzz_cozens is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    25
    Works perfectly. Thanks very much.

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

Similar Threads

  1. Replies: 43
    Last Post: 08-06-2014, 08:21 PM
  2. Replies: 6
    Last Post: 05-05-2014, 10:51 PM
  3. Replies: 4
    Last Post: 05-26-2013, 03:28 PM
  4. Convert Date Value to ONLY Name of Month
    By taimysho0 in forum Programming
    Replies: 2
    Last Post: 02-23-2012, 08:05 PM
  5. Update Query Dependent on the month
    By hawkins in forum Queries
    Replies: 3
    Last Post: 07-12-2011, 08:54 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