Hello team,
I have a date column whose date type is numeric, it is as: 7/20/2020
I want to place this date in a where clause.
Where date = '20Jul2020'd;
This doesn't bring any rows.
What is the reason?
Thanks,
blue blue
Please post the complete log of the step.
In addition to @Kurt_Bremser's request, please provide examples of typical values of the variable DATE that you are working with, and the FORMAT of the variable DATE.
If this data was imported from Excel, you might have "hidden" time information in it, because Excel stores times as fractions of a day, not counts as seconds.
As illustration run this short code and look at the log:
data _null_;
format date mmddyy10.;
date = '20Jul2020'd;
put "date as is " date;
if date = '20Jul2020'd then put "yes";
date = date + .1;
put "date after addition " date;
if date = '20Jul2020'd then put "yes"; else put "no";
run;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.