I am trying to merge two tables with below code:
proc sql;
create table test as
select a.*, b.*
from aaa a
left join bbb b on a.id=b.id and a.date1<=b.date2;
quit;
But the output shows blanks in columns from table b.
However if I change it to a.date1>=b.date2 it seems to work. Why would this be happening?
Checks I have done to be sure: 1) date formats are ok; 2) there are dates in table aaa which are less and more than table b dates.
Please help!
ok so looks like when I add datepart to both dates it works perfectly fine. Hopefully this will come in handy to someone.