+ Reply to Thread
Results 1 to 4 of 4

Change date format from YYYY-MM-DD hh:mm:ss to YYYY-MM-DD

  1. #1
    Registered User
    Join Date
    02-10-2010
    Location
    Sacramento, Ca, USA
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    33

    Unhappy Change date format from YYYY-MM-DD hh:mm:ss to YYYY-MM-DD

    I have imported data from a database where the date format shows date and time. When I change the formatting to show only YYYY-MM-DD the cell shows the right format but if I select the cell it still contains the time (hh:mm:ss) and as I am using the value in a Pivottable and need to sort by date and find out how many times a day a truck has been loading, I need to get rid of the time stamp and only use the date. I am now using Excel 2010 but when I used 2003 I could use the function Left and 10 digits. When I try that now I get the built-in Excel numbers for the day and it does not work. Can anyone help me to get only the 10 digit date-format? How do I get rid of the built-in Excel day number?
    Last edited by Gunilla; 07-16-2012 at 12:27 PM.

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Change date format from YYYY-MM-DD hh:mm:ss to YYYY-MM-DD

    if it's actually a date/time field and not text you should be able to group the field in the pivot by day (assuming no blanks) to get the behavior you want
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Forum Moderator Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Change date format from YYYY-MM-DD hh:mm:ss to YYYY-MM-DD

    Maybe one way is to use Text To Columns option.

    Go there and follow the instructions.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Registered User
    Join Date
    02-10-2010
    Location
    Sacramento, Ca, USA
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    33

    Re: Change date format from YYYY-MM-DD hh:mm:ss to YYYY-MM-DD

    Thank you. That works, now I just have to find a way to write the code.

+ 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