I've been working with it and got it to work somewhat, but my WHERE filter has errors, I need only the max date that is Actual in each category.
left JOIN ( SELECT Customer_ID
, MAX(Civil_Status_Date)as Civil_Date
, MAX(Power_Status_Date)as Power_Date
, MAX(Construction_Complete_Date)as CC_Date
FROM [Server].[dbo].[Projects] (NOLOCK)
WHERE Civil_Status = 'Actual' and Power_Status = 'Actual' and Construction_Complete = 'Actual' and
GROUP BY Customer_ID
) Projects ON Report.Customer_ID=Projects.Customer_ID
Sample dataset below, How would I get the latest Date from multiple columns marked "Actual".
In the table below I want it to return
Customer /// Last_Construction_Date
3956 /// 4/9/2023
4655 /// 7/1/2023
Any help appreciated! ty!