LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  DateTime conversion to Date

    Employee
    Posted 12-12-2014 10:08

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: AndyBeale

    I have a field in my dataset that is currently formatted as a datetime (e.g. 2014-11-30 12:01:16)

    I want to convert this field to be a date (e.g. 2014-11-30 or D/M/CCYY)

    I have tried to convert using lots of different syntax but none works. There must be a simple solution that is eluding me..... please help before I lose the plot!

    Thanks

    Andy


  • 2.  RE: DateTime conversion to Date

    Employee
    Posted 12-12-2014 10:13

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: stonysmith

    If the field is already a datetime data type, you can simply use date(myfield) to remove the time.
    However, if the field is a string, then you can use date(left(myfield,10),"CCYY-MM-DD")


  • 3.  RE: DateTime conversion to Date

    Employee
    Posted 12-12-2014 10:23

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: AndyBeale

    I knew it would be simple - I was trying to convert to a string or unicode and then use left or substr - I was over complicating it.

    Thanks a lot