Hi All,
When i am using below in SAS it is working fine:-
proc SQL ;
Select datepart(created_date) format=MONYY.
from ora.table1 ;
quit;
But when i am using same format in WHERE clause it is not working and giving error:-
PROC SQL ;
Delete from ORA.table1
WHERE datepart(created_date) format=MONYY. = put(today(),MONYY.) ;
What would be right way to get MONYY format in WHERE clause
Thanks,
RDS
You need:
WHERE put(datepart(CREATED_DATE),monyy.) = put(today(),monyy.)
It might better to use
WHERE month(CREATED_DATE)=month(today()) and year(CREATED_DATE)=year(today())
as this might readily be translated into a condition that Oracle can process.
Use option SASTRACE to check the Oracle query.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.