shahromi
15th July 2016, 04:38
Hi All,
How to write SQL in report script to get the latest value based on the latest date.
From table TCMCS008, I want to get the latest RATE value based on latest APDT date.
My SQL:
select MAX(tcmcs008.apdt):maxapdt, Last(tcmcs008.rate):LastRATE
from tcmcs008
where tcmcs008.ccur = {:rep.inv.ccur}
and tcmcs008.rtyp = "INT"
selectdo
endselect
Can anybody assist me, instead of use Last, any reserve word which this script will understand.
SQLState 42I00: Unexpected token 'last' (error 302)
Thank You.
How to write SQL in report script to get the latest value based on the latest date.
From table TCMCS008, I want to get the latest RATE value based on latest APDT date.
My SQL:
select MAX(tcmcs008.apdt):maxapdt, Last(tcmcs008.rate):LastRATE
from tcmcs008
where tcmcs008.ccur = {:rep.inv.ccur}
and tcmcs008.rtyp = "INT"
selectdo
endselect
Can anybody assist me, instead of use Last, any reserve word which this script will understand.
SQLState 42I00: Unexpected token 'last' (error 302)
Thank You.