I have a code as below, i need to take the select max(date) in seperate code. it takes so much time. How can i seperate them
This is the code
proc sql;
create table aa as
select a.vid,
a.activity_date,
a.hour,
a.from_date,
b.req,
b.perehis_act_date
from stg.coa a,
stg.wte b
where a.EMPLOYEE_PIDM = b.perehis_pidm
and b.perehis_act_date = (select max(x.perehis_act_date)
from stg.wte x
where x.perehis_pidm=b.perehis_pidm
and x.perehis_Act_date <= a.from_date )
and datepart(a.from_date) <= (select max(datepart(e.end_date))
from stg.comp e
where today()GE datepart(e.end_date)+14);
quit;
I need this query to simple couple query. Thank you
... View more