I'm trying to fix my query to display results even if no comments are made in a record.
Currently it will only display records that have a comment, but if a record has no comment, the record is never displayed during a query run, which is causing havoc in my database.
I thought I could use a conditional statement to resolve it, but I get no results when I use the following:
IIf (IsNull ([NoteDate]),[Notes]="No Comments"))
Here is my SQL:
SELECT tblNotes.ClientID, Max(tblNotes.NoteDate) AS MaxOfNoteDate
FROM tblNotes
WHERE (((tblNotes.NoteDate)=IIf(IsNull([NoteDate]),[Notes]="No Comments")))
GROUP BY tblNotes.ClientID;
Without the IF statement everything works fine, unless a record has no comments, which means it has no date for the Max function to process.
I was hoping the IF statement would resolve this by reasoning that if the NoteDate field is Null then it would add the No Comments to the Notes field, thus making the comment record not Null, and thereby displaying the No Comment record in the results. Unfortunately, now I don't get any results!
I think Access hates me
Any suggestions?
Thanks
Mike