The following query does not return a value for CurrentVisitor in the my ms access 2010 database:
SELECT h.ClientNumber, IIf(h.CheckoutDate=null,"Yes","") AS CurrentVisitor FROM VisitsTable AS h INNER JOIN ( SELECT ClientNumber, MAX(LastVisitDate) AS LastVisitStart FROM VisitsTable GROUP BY ClientNumber) AS t ON (h.LastVisitStart = t.LastVisitStart) AND (h.ClientNumber = t.ClientNumber);
I think the reason is that the null check in the If() operation is spelled incorrectly. Can someone show me how to fix this?
sql ms-access
Codemed
source share