Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Missing Logic for Last Review date

hi experts

  from bellow query i'm not getting emp last hike date

SELECT T0.[empID], T0.[firstName],T0.[salary] ,T1.[remarks],

(SELECT max  (T1.[Date] ) FROM OHEM T0 full JOIN HEM3 T1 ON T0.empID = T1.empID )

  FROM OHEM T0 full JOIN HEM3 T1 ON T0.empID = T1.empID WHERE T0.[status] is null  AND  T0.[termReason] IS NULL

please help me

Thanks & Regards

  Andakondaramudu

Tags:
replied

Hi,

Try this,

SELECT T0.[empID], T0.[firstName],T0.[salary],Max(convert(nvarchar(max),T1.[remarks])) Remarks,MAX(T1.[Date]) HighDate

FROM OHEM T0 LEFT OUTER JOIN HEM3 T1 ON T0.empID = T1.empID

WHERE (T0.[status] IS NULL)  AND  (T0.[termReason] IS NULL)

group by T0.[empID], T0.[firstName],T0.[salary]

Thanks & Regards,

silambu

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question