Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Access (https://www.askmehelpdesk.com/forumdisplay.php?f=441)
-   -   Convert number to date format (https://www.askmehelpdesk.com/showthread.php?t=602792)

  • Oct 10, 2011, 11:38 PM
    nurmala
    Convert number to date format
    Hi..
    I am currently in trouble converting number to date format. I have a set of number for example : 110930 (text formatted, 6 digits)which represent 30 SEPT 2011.
    Could any one give me a way out to convert the number into DD-MONTH-YY (30-SEPT-11)?

    Thank you very much, indeed
  • Oct 10, 2011, 11:50 PM
    Curlyben
    What are you using for this conversation process.
    Is this on a spreadsheet or in Windows ?
  • Oct 11, 2011, 03:54 AM
    ScottGem
    This depends on the software. Without knowing that, we can't provide a function to do it. Most spreadsheet or database software products will have functions to parse this out
  • Oct 11, 2011, 06:39 PM
    nurmala
    I am using ms. access 2002 - 2003 format.


  • Oct 11, 2011, 07:07 PM
    ScottGem
    =DateSerial(Left([field]),Mid([field],3,2),Right([field],2))

    You may have to convert the field to text first.
  • Oct 11, 2011, 07:30 PM
    nurmala
    Already converted the field (F2) into text, typed the formula:

    DateSerial(LEFT(F2,2),MID(F2,3,2),RIGHT(F2,2))
    But it results #NAME?

    Why is that?
  • Oct 11, 2011, 07:38 PM
    ScottGem
    Where did you type it?
  • Oct 11, 2011, 07:44 PM
    nurmala
    On the formula bar, in excel spreadsheet.
  • Oct 11, 2011, 07:53 PM
    ScottGem
    You said you were using Access, not Excel. Excel doesn't have a DateSerial function, the equivalent is the Date() function.
  • Oct 11, 2011, 08:03 PM
    nurmala
    You you... my fault.. :)

    It Works!! I changed the DateSerial function into Date function in spreadsheet, and it turned the date format I wanted.

    Thanks guys for your help...
  • Oct 12, 2011, 03:11 AM
    ScottGem
    I'm glad you got it. But for future reference you can see how asking a complete question and posting in the right place can make a difference. You could have had this answer yesterday morning, if you had correctly given the software you were using. Or if you had originally posted in the Spreadsheet forum instead of the Windows forum we would have offered the correct answer.
  • Nov 24, 2011, 07:05 PM
    nurmala
    Same problem guys. I have 110113 in cell F2 (already in text format, in Excel). I want to change it to DATE format, so

    =DATE(LEFT(F2),MID(F2,3,2),RIGHT(F2,2), but it turned to 1/13/1901. It is supposed to be 1/13/2011, right?

    any advice on this?

    thanks



  • Nov 24, 2011, 07:40 PM
    ScottGem
    Try

    DATE(2000 + Val(LEFT(F2,2)),MID(F2,3,2),RIGHT(F2,2), but it turned to 1/13/1901
  • Nov 24, 2011, 07:45 PM
    nurmala
    Did not work. It turned #NAME?

    formula I typed : =DATE(2000+Val(LEFT(F2,2)),MID(F2,3,2),RIGHT(F2,2) )

    :(
  • Nov 24, 2011, 07:49 PM
    nurmala
    YEAY! It works! I typed VALUE, instead of Val..

    thanks a lot Scott :)
  • Nov 25, 2011, 06:14 AM
    ScottGem
    You're welcome. The point is that you had to set the parameter for the full 4 digit year.

    Now the problem is if you have any dates in the last century.

  • All times are GMT -7. The time now is 10:02 AM.