I copied the datetime out of the table but I get an error. The format is
CREAT_DTTM num format=DATETIME24.3 informat=DATETIME24.3 label='CREAT_DTTM',
and hsc.CREAT_DTTM >= '25MAR2014:14:04:41.652' and hsc.CREAT_DTTM <= '25MAR2014:14:15:46.424' ERROR: ORACLE execute error: ORA-01849: hour must be between 1 and 12.
Are you passing this values within implicit or explicit SQL code.
If it's withing implicit SAS SQL code (=not within a connect to ... bit) then you need to tell SAS that it needs to interpret the string as a datetime value by adding dt after the quote.
and hsc.CREAT_DTTM >= '25MAR2014:14:04:41.652'dt and hsc.CREAT_DTTM <= '25MAR2014:14:15:46.424'dt
If above works then you're facing another challenge which is about precision when moving floating point values between environments. Let's address this if above is what makes things work.
If it's pass-through SQL then you need to instruct Oracle to interpret the string as a timestamp value. The To_Timestamp() function allows for this.
It seems that oracle expects time in am/pm notation, the format DATEAMPM30.3 should display the datetime in the expected format.
If you're suggesting to change the format of the column to DATEAMPM30.3 that is not possible. I have no control over the format that was chosen. Thanks.
Are you passing this values within implicit or explicit SQL code.
If it's withing implicit SAS SQL code (=not within a connect to ... bit) then you need to tell SAS that it needs to interpret the string as a datetime value by adding dt after the quote.
and hsc.CREAT_DTTM >= '25MAR2014:14:04:41.652'dt and hsc.CREAT_DTTM <= '25MAR2014:14:15:46.424'dt
If above works then you're facing another challenge which is about precision when moving floating point values between environments. Let's address this if above is what makes things work.
If it's pass-through SQL then you need to instruct Oracle to interpret the string as a timestamp value. The To_Timestamp() function allows for this.
Patrick,
I'm sorry it took me so long to get back to this but it worked. Thanks a lot.
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.