Skip to main content
1-Visitor
April 24, 2018
Question

Getting date from datetime format

  • April 24, 2018
  • 2 replies
  • 1702 views

I have a table with a column with datetime format .I need to create another column which will contain only date.

Can any one help on this.

    2 replies

    23-Emerald IV
    April 24, 2018

    Not sure what product you are using, but this area is for the eSupport tools on PTC.com.  Things like the knowledge base, case creator, etc.  You will probably have better luck posting your question in the appropriate product area.

     

    PTC Community Product Areas.PNG

    23-Emerald III
    April 24, 2018

    Where is the datetime coming from?

     

    If from a Windchill parameter, use an extract statement in relations to get the date only portion.

    date_only = extract(ptc_wm_created_on,1,10)

    This will pull the 10 characters of the date (2018-04-24) from the parameter ptc_wm_created_on. You may use  ptc_wm_modified_on depending on your needs.

    1-Visitor
    April 24, 2018

    Not from windchill

    23-Emerald III
    April 24, 2018

    Where is the datetime coming from?

     

    In order to be in a table in Creo, it has to be in Creo as a parameter. Use the same extract code, but use your parameter instead of the Windchill one in my example. IF the date is not the first 10 charcaters, adjust the start position (1) and the end position (10) for your string. You can get fancy with relations and totally format any way you want by extracting the various segments.