Hi there, I'm trying to hardcode the SQL for a Crystal report. I want to return the row that has the max effective date (I need to get around using the group select function that Crystal offers which is why I want to hardcode).
I've tried and I just can't get it. Is there a way to use a subselect, i.e. EXISTS with the MAX function in that?
Here is the basic SQL - some of the examples I see have the joins but I have joined the tables already in the designer. Thanks!
SELECT
PS_ADDRESSES."EMPLID", PS_ADDRESSES."EFFDT"
FROM
"SYSADM"."PS_ADDRESSES" PS_ADDRESSES
WHERE
PS_ADDRESSES."EMPLID" LIKE '______002'
ORDER BY
PS_ADDRESSES."EMPLID" ASC
I've tried and I just can't get it. Is there a way to use a subselect, i.e. EXISTS with the MAX function in that?
Here is the basic SQL - some of the examples I see have the joins but I have joined the tables already in the designer. Thanks!
SELECT
PS_ADDRESSES."EMPLID", PS_ADDRESSES."EFFDT"
FROM
"SYSADM"."PS_ADDRESSES" PS_ADDRESSES
WHERE
PS_ADDRESSES."EMPLID" LIKE '______002'
ORDER BY
PS_ADDRESSES."EMPLID" ASC