How to Change DATETIME20. TO MMDDYY9.

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 6
Accepted Solution

How to Change DATETIME20. TO MMDDYY9.

 

I have a dataset with date column in DATETIME20.

May i know how i can change it to MMDDYY9. ?

 

Thanks


Accepted Solutions
Solution
‎03-19-2018 03:57 AM
Super User
Posts: 3,927

Re: How to Change DATETIME20. TO MMDDYY9.

Posted in reply to nicolaskan

If the column has a format of datetime20. then it is a datetime column not a data one. To convert it to a date column try this:

data want;
  set have;
  Date_Column = datepart(Date_Column);
  format Date_Column mmddyy9.;
run;

View solution in original post


All Replies
Solution
‎03-19-2018 03:57 AM
Super User
Posts: 3,927

Re: How to Change DATETIME20. TO MMDDYY9.

Posted in reply to nicolaskan

If the column has a format of datetime20. then it is a datetime column not a data one. To convert it to a date column try this:

data want;
  set have;
  Date_Column = datepart(Date_Column);
  format Date_Column mmddyy9.;
run;
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 101 views
  • 2 likes
  • 2 in conversation