The following query is not returning values for CurrentVisitor
in 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 check for null in the If()
operation is not written correctly. Can anyone show me how to fix this?
Use
Is Null
rather than
= Null
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With