i need to calculate this within a proc sql querym i've tried a number of things to get it right. i see the problem, since when i do datepart(sampledate) it returns an integer, but datepart(filedate) returns 0 so the intck calculation is way off. how do i get datetime and date9 to play well together in the query?
Both variables have to be the same units ... in one case, the variable that is DATE9. is measured internally in units of days; the variable that is DATETIME26.7 is measured in units of seconds.
You have to convert the DATETIME26.7 variable to days, or alternatively convert the DATE9. variable to seconds, and then you can do this.
The datepart function converts datetime values measured in seconds to date values measured in days, and then the arithmetic works.
-- Paige Miller
SAS INNOVATE 2024
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.