以下查询未CurrentVisitor
在我的 ms access 2010 数据库中返回值:
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);
我认为原因是If()
操作中对null的检查没有正确写入。谁能告诉我如何解决这个问题?