Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
it's kind of a miss or hit thing. sometimes it works and other times it doesn't.
I need to find values with latest date. I usually use this method, but it's too long. Any good suggestion to make my life easier? thanks
P;
sql select distinct load_date from tbl1;
P2:
load max(load_date) as MaxDate
resident P;
let vMaxD = peek('MaxDate', 0, 'P')
drop table P;
drop table P2;
Rtble:
sql select * from tbl1
where load_date ='$(vMaxD)';
Hi,
Try this
P:
sql select Max(load_date) from tbl1;
let vMaxD = peek('MaxDate', 0, 'P')
drop table P;
Rtble:
sql select * from tbl1
where load_date ='$(vMaxD)';
Hope this helps you.
Regards,
Jagan.
Hi,
Try this
P:
sql select Max(load_date) from tbl1;
let vMaxD = peek('MaxDate', 0, 'P')
drop table P;
Rtble:
sql select * from tbl1
where load_date ='$(vMaxD)';
Hope this helps you.
Regards,
Jagan.
Maybe just move the Max() into the first SQL statement?
P:
Load
load_date
;
sql select max(load_date) from tbl1;
let vMaxD = peek('load_date')
drop table P2;
Rtble:
sql select * from tbl1
where load_date ='$(vMaxD)';
Oops - not sure why I didn't see Jagan's answer there already!