DATA Step, Macro, Functions and more

Date Format Help!!

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

Date Format Help!!

Hi how would i convert from DDMMMYYYY:hh:dd:ss to a YYYYY-MM-DD

 

Example:

 

column ABC : 24OCT2015:02:24:33 covert to 2015-10-24

 

Im using PROC SQL. 

 

A beginner so please let me know step by step, THANK YOU!


Accepted Solutions
Solution
‎02-24-2016 12:33 PM
Super User
Posts: 17,829

Re: Date Format Help!!

Use the datepart() function and apply a format so it looks the way you want it.

 

DATEPART(ABC) as ABC_DATE format=yymmdd10.

View solution in original post


All Replies
Solution
‎02-24-2016 12:33 PM
Super User
Posts: 17,829

Re: Date Format Help!!

Use the datepart() function and apply a format so it looks the way you want it.

 

DATEPART(ABC) as ABC_DATE format=yymmdd10.
New Contributor
Posts: 3

Re: Date Format Help!!

This is what i have but its not working..

rsubmit;
proc sql;
create table test1.allwcases1 as
select A.*
from test1.allwcases A
datepart(A.creation_time) as C_time format=YYMMDD10
;
endrsubmit;
New Contributor
Posts: 3

Re: Date Format Help!!

nvm.. works thanks!
☑ This topic is SOLVED.

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

Discussion stats
  • 3 replies
  • 184 views
  • 1 like
  • 2 in conversation