Separate Date:Time variable to Date and Time variables

Reply
N/A
Posts: 0

Separate Date:Time variable to Date and Time variables

I have a DATETIME variable that looks like 15NOV2007:09:08:00. I want to separate the Date and Time into separate variables. How do I do this while keeping the formatting. Thanks.
Trusted Advisor
Posts: 2,122

Re: Separate Date:Time variable to Date and Time variables

Posted in reply to deleted_user
Use the DATEPART and TIMEPART functions to extract the pertinent pieces and then apply the appropriate formats to the resulting variables.
N/A
Posts: 0

Re: Separate Date:Time variable to Date and Time variables

Thanks. I found the function about an hour after I posted.
Ask a Question
Discussion stats
  • 2 replies
  • 431 views
  • 0 likes
  • 2 in conversation