Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2004
    Location
    Nashville
    Posts
    52

    Angry Unanswered: String manipulation

    I have some existing records that need to be edited. About 2,500 of them. The field is for Date of Birth and someone set it up as a text field with the dates entered as mm/dd/yy (No actual format). I need to insert a value of 19 to create a format of mm/dd/yyyy. For example, 01/06/63 needs to be 01/06/1963. After I fix this issue, I will create a new table with the proper Date/Time data type and format and import the records. (The new table is being created because additional fields are being added.) I can't seem to find a string manipulation function that will accomplish this task. Any suggestions?

  2. #2
    Join Date
    May 2004
    Posts
    18
    Why don't you use the format function

    lets say you have dateofbirth = 09/06/69

    you can format it to the format you want using

    format(dateofbirth, "dd/mm/yyyy")
    this will return 09/06/1969

    For more information, click on help, format and date

    sorry, that's just how much i know I have a problem with string manipulation myself...

    Maybe someone else will be able to help...

  3. #3
    Join Date
    Nov 2003
    Posts
    1,487
    On the nail

  4. #4
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    Or you could use Cdate() function. Like:

    Dim StrDate as String, RegDate as Date
    StrDate="1/1/63")
    RegDate=CDate(StrDate)
    ghozy.

  5. #5
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    I would just change the field type for the field. Access will automatically try to convert it to a date using CDate. If you are concerned that it won't convert properly make a copy of the table or make a copy of the database before you try it.

Posting Permissions

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