+ Reply to Thread
Results 1 to 6 of 6

Time

  1. #1
    DD
    Guest

    Time

    I have a field in a delimited CSV. file 20060229 and want to convert it to a
    date field reading 29/02/2006. How can I do that?

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    You can't because there's no such date as 29/02/2006 but if you have a real date e.g. 20060228 you can either...

    ..use Data > Text to Columns and at step three choose date option and YMD.

    or with a formula, assuming your "date" in A1

    =DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2))

  3. #3
    Gary''s Student
    Guest

    RE: Time

    There are only 28 days in February in 2006. You should get March 1 as
    1/3/2006 using =DATE(LEFT(A1,4),MID(A1,5,2),(RIGHT(A1,2)))
    --
    Gary's Student


    "DD" wrote:

    > I have a field in a delimited CSV. file 20060229 and want to convert it to a
    > date field reading 29/02/2006. How can I do that?


  4. #4
    Dave Peterson
    Guest

    Re: Time

    After you import the .csv file, you can select that field and use data|text to
    columns.

    You can specify ymd as the field type.

    DD wrote:
    >
    > I have a field in a delimited CSV. file 20060229 and want to convert it to a
    > date field reading 29/02/2006. How can I do that?


    --

    Dave Peterson

  5. #5
    CLR
    Guest

    Re: Time

    You can only make it TEXT to appear to be 29/02/2006.

    =RIGHT(A1,2)&"/"&MID(A1,5,2)&"/"&LEFT(A1,4)

    If turned into a DATE it becomes 3/1/3006 as there is no Feb 29th in
    2006.....

    =DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2))

    Vaya con Dios,
    Chuck, CABGx3



    "DD" <[email protected]> wrote in message
    news:[email protected]...
    > I have a field in a delimited CSV. file 20060229 and want to convert it to

    a
    > date field reading 29/02/2006. How can I do that?




  6. #6
    CLR
    Guest

    Re: Time

    Sorry, 3/1/2006 not 3/1/3006...."you know what I meant"....the formula is
    ok, just mine typing is tired.......bed time here in St. Petersburg,
    Florida......

    Vaya con Dios,
    Chuck, CABGx3




    "CLR" <[email protected]> wrote in message
    news:[email protected]...
    > You can only make it TEXT to appear to be 29/02/2006.
    >
    > =RIGHT(A1,2)&"/"&MID(A1,5,2)&"/"&LEFT(A1,4)
    >
    > If turned into a DATE it becomes 3/1/3006 as there is no Feb 29th in
    > 2006.....
    >
    > =DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2))
    >
    > Vaya con Dios,
    > Chuck, CABGx3
    >
    >
    >
    > "DD" <[email protected]> wrote in message
    > news:[email protected]...
    > > I have a field in a delimited CSV. file 20060229 and want to convert it

    to
    > a
    > > date field reading 29/02/2006. How can I do that?

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1