Hi guys,
Im trying to use a alias with in a query but don’t seem to be getting the syntax correct.
I need to find the due date then use it to determine if its late or early.
Example
select z.DueDate, c.Name, case when z.DueDate < getdate() then 'Future' else 'ODue' end as 'ODUE'
from (Select CASE WHEN c.AckDate IS NULL
THEN c.RequiredDate ELSE c.AckDate END AS DueDate
From PURCHASE_ORDER_DETAIL c)z
Any help would be grateful
Regards
Im trying to use a alias with in a query but don’t seem to be getting the syntax correct.
I need to find the due date then use it to determine if its late or early.
Example
select z.DueDate, c.Name, case when z.DueDate < getdate() then 'Future' else 'ODue' end as 'ODUE'
from (Select CASE WHEN c.AckDate IS NULL
THEN c.RequiredDate ELSE c.AckDate END AS DueDate
From PURCHASE_ORDER_DETAIL c)z
Any help would be grateful
Regards