Here is what I am using:
IIf([ODS_LSE_ACCT_STATUS].[VIN_NBR] Is Not Null,IIf([Sales].[Assigned_Dt]-[Grounding].[Ground_Dt]>0,[Sales].[Assigned_Dt]-[Grounding].[Ground_Dt],IIf(Last([Sales].[Assigned_Dt]-[ODS_REPO_ASSET].[REPO_DT])>0,Last([Sales].[Assigned_Dt]-[ODS_REPO_ASSET].[REPO_DT]),Null)))
Why am I getting the error?
Cannot have an aggregate function in a GROUP BY clause
IIf([ODS_LSE_ACCT_STATUS].[VIN_NBR] Is Not Null,IIf([Sales].[Assigned_Dt]-[Grounding].[Ground_Dt]>0,[Sales].[Assigned_Dt]-[Grounding].[Ground_Dt],IIf(Last([Sales].[Assigned_Dt]-[ODS_REPO_ASSET].[REPO_DT])>0,Last([Sales].[Assigned_Dt]-[ODS_REPO_ASSET].[REPO_DT]),Null)))
Why am I getting the error?
Cannot have an aggregate function in a GROUP BY clause