Results 1 to 2 of 2
  1. #1
    tasam21 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Aug 2011
    Posts
    1

    how to convert field with data type Text into Date/Time format


    In my table i have a field with list of record like 12091999 as a type Text. how can i change all the record under that field into format like 12/09/1999 by giving Date/Time data type.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    An approach would be:

    Create a new field in your Table with type Date, say MyDate.

    Create a query with the text field in question ( the string "12091999"). Let's say this field is txtDate.

    UPDATE testCharDate
    SET testCharDate.MyDate = CDate(Left([txtField],2) & "/" & Mid([txtField],3,2) & "/" & Right([txtField],2));

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

Similar Threads

  1. Replies: 5
    Last Post: 07-18-2011, 06:07 PM
  2. format of text data type
    By frcastro in forum Access
    Replies: 4
    Last Post: 06-23-2010, 09:36 AM
  3. Replies: 1
    Last Post: 05-17-2010, 12:21 PM
  4. Convert date format yyyymmdd for datediff
    By TEN in forum Programming
    Replies: 1
    Last Post: 06-17-2009, 09:35 PM
  5. Replies: 1
    Last Post: 06-11-2009, 05:40 PM

Tags for this Thread

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