G
Guest
I have the following SQL
PARAMETERS [Start Date] DateTime, [End Date] DateTime
SELECT Compare2.ClNum, First(Compare2.[Client Name]) AS [FirstOfClient Name], Count(Compare2.ClNum) AS COUNTOFCLNUM, First(Compare2.EnrollDt) AS FirstOfEnrollDt, Last(IIf([EnrollDt]=[Start date],"Dropped","New")) AS Statu
FROM Compare
WHERE (((Compare2.EnrollDt) Between [Start Date] And [End Date])
GROUP BY Compare2.ClNu
HAVING (((Count(Compare2.ClNum))=1))
The part of the SQL that says "Last(IIf([EnrollDt]=[Start date],"Dropped","New")) AS Status" is not working. It works if the EnrollDt is equal to the date entered into the parameter [Start Date] but if the Start Date is greater than the EnrollDt than it doesn't work. I don't know how to construct this so the "day" doesn't matter - just the mth and year. Any help would be appreciated. Also, please be specific because I am new to Access.
PARAMETERS [Start Date] DateTime, [End Date] DateTime
SELECT Compare2.ClNum, First(Compare2.[Client Name]) AS [FirstOfClient Name], Count(Compare2.ClNum) AS COUNTOFCLNUM, First(Compare2.EnrollDt) AS FirstOfEnrollDt, Last(IIf([EnrollDt]=[Start date],"Dropped","New")) AS Statu
FROM Compare
WHERE (((Compare2.EnrollDt) Between [Start Date] And [End Date])
GROUP BY Compare2.ClNu
HAVING (((Count(Compare2.ClNum))=1))
The part of the SQL that says "Last(IIf([EnrollDt]=[Start date],"Dropped","New")) AS Status" is not working. It works if the EnrollDt is equal to the date entered into the parameter [Start Date] but if the Start Date is greater than the EnrollDt than it doesn't work. I don't know how to construct this so the "day" doesn't matter - just the mth and year. Any help would be appreciated. Also, please be specific because I am new to Access.