BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
itshere01
Calcite | Level 5

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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

3 REPLIES 3
Reeza
Super User

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

 

DATEPART(ABC) as ABC_DATE format=yymmdd10.
itshere01
Calcite | Level 5
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;
itshere01
Calcite | Level 5
nvm.. works thanks!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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