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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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