BookmarkSubscribeRSS Feed
yesidgranadosv
Obsidian | Level 7
I have the courage to FECHA_INGRESO 
fecha ingreso = SUBSTR(t1.fecha_ingreso, 1, 20)
which delivers as a result 2014-04-03 00:00:00
 
I want to have this same date removing the ' - '  and ' : ' 
 
you can tell me what function I can use for this
 
 
 
3 REPLIES 3
Reeza
Super User

Use COMPRESS()

 

I would recommend storing your dates as SAS dates and using formats instead of characters.

There's a great reference on dates and times in the Community Library on this site.

 


@yesidgranadosv wrote:
I have the courage to FECHA_INGRESO 
fecha ingreso = SUBSTR(t1.fecha_ingreso, 1, 20)
which delivers as a result 2014-04-03 00:00:00
 
I want to have this same date removing the ' - '  and ' : ' 
 
you can tell me what function I can use for this
 
 
 

 

PeterClemmensen
Tourmaline | Level 20

So you have a character 'datetime value'. Do you want this to be an actual numeric datetime value?

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1148 views
  • 0 likes
  • 4 in conversation