To me this looks correct, however it is not working.
The statement is:
IIf([Last Date]="No Elme","No Elme",IIf([Last Date]>=[Pressure_Inspctn Target Date],"Up to Date",[Last Date]))
Here are the SQL details:
SELECT [qryBase_LstDate_Pressr_PerUnit B].Ramp_Code,
[qryBase_LstDate_Pressr_PerUnit B].[Lift_Unit#],
IIf([Last Date]="No Elme","No Elme",IIf([Last Date]>=[Pressure_Inspctn Target Date],"Up to Date",[Last Date]))
AS Pressure_Insp_Date FROM [qryBase_LstDate_Pressr_PerUnit B] INNER JOIN qryBase_Prs_TrgtDate
ON [qryBase_LstDate_Pressr_PerUnit B].Ramp_Code = qryBase_Prs_TrgtDate.Ramp_Code
GROUP BY [qryBase_LstDate_Pressr_PerUnit B].Ramp_Code, [qryBase_LstDate_Pressr_PerUnit B].[Lift_Unit#], IIf([Last Date]="No Elme","No Elme",IIf([Last Date]>=[Pressure_Inspctn Target Date],"Up to Date",[Last Date]));
My problem is that instead of bringing back "Up to Date", it just gives me the last date. Originally I did not have the first Iif statement in there, thinking that since the query with [Last Date] was written to bring back either the max date or "No Elme", that "No Elme" would come back as [Last Date], but it didn't.
Any ideas or thoughts?
Thanks,
Kathy