Hi SAS Community.
This is what i am facing currently. I am having difficulty to convert SAS Datetime to SQL Datetime.
The display value in SAS Datetime is 28Mar2018:10:01:06 which is actually "28Mar2018:10:01:96"dt when doing Proc SQL.
The display value is SQL Datetime is 2018-03-28 10:01:06.000 which is actually '2018-03-28 10:01:06.000' when using SQL Pass through.
I have the SAS datetime value and want to use it in SQL Pass through statement. I have been finding online but i couldnt find any related information. The most i could find is only converting Date.
The Passthrough statement should be something like this(without the connect to xxx statement)
%let sasdatetime=2018-03-28 10:01:06.000; /*How to convert the value above to SQL format and apply in proc sql below*/ Proc sql: connect to xxx select * from table A where birthdatetime = &thedatetime;
Seeking for your kind advice.
Like this?
where birthdatetime = %nrbquote('&sasdatetime') ;
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.