Results 1 to 3 of 3
  1. #1
    imintrouble is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Location
    Missouri, where frownin's a sport
    Posts
    127

    turning a string into a date

    Hello! I am doing a project which currently requires me to input a new file we just got. However, the dates on all of them, as in the field containing the dates, displays something like 20030608 instead of June 8, 2003. I was thinking I could just run the file through a looped vb array to go through the information, reformat it, and then dump it into a new column. If any other information is needed, please feel free to ask.



    Thanks!

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    You could do this in a query. Separate the date string into three fields, day, month and year using the right and left functions. In a fourth field you could combine into the date format you want using the format function.

  3. #3
    pdebaets is offline Competent Performer
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    235
    You can update the new column with one sql statement like so:

    CurrentDB().Execute "Update MyImportTable Set MyNewDateField = cdate(mid(MyImportedDateField,5,2) & '/' & right(MyImportedDateField,2) & '/' & left(MyImportedDateField,4));"

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

Similar Threads

  1. Turning a cell red
    By Sharong in forum Access
    Replies: 3
    Last Post: 09-28-2011, 01:51 PM
  2. Replies: 2
    Last Post: 07-03-2010, 08:45 PM
  3. Split string into Date and Time Columns?
    By Hobbes29 in forum Queries
    Replies: 2
    Last Post: 06-08-2010, 06:50 PM
  4. Help with date stored as string
    By weisslakeguy in forum Queries
    Replies: 8
    Last Post: 05-26-2010, 11:14 AM
  5. Convert string to date
    By ~SwAmPdOnKeY~ in forum Queries
    Replies: 4
    Last Post: 09-11-2008, 07:19 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