I have the following expression in a query field:
When I add a text criteria to it and change back to datasheet view I get the Data Type mismatch error. Each of the fields referenced in the expression are text fields and the criteria I set is set in quotes so not sure why I'm getting this error.
Any ideas please?
SELECT Documents.ID, IIf(InStrRev([MainDept] & ("/"+[Referral1]) & ("/"+[Referral2]) & ("/"+[Referral3]) & ("/"+[Referral4]) & ("/"+[Referral5]),"/")=0,[MainDept],Mid([MainDept] & ("/"+[Referral1]) & ("/"+[Referral2]) & ("/"+[Referral3]) & ("/"+[Referral4]) & ("/"+[Referral5]),InStrRev([MainDept] & ("/"+[Referral1]) & ("/"+[Referral2]) & ("/"+[Referral3]) & ("/"+[Referral4]) & ("/"+[Referral5]),"/")+1)) AS Expr1, Documents.SubjectID, Documents.FirstName, Documents.LastName, Documents.Received, Documents.DocID
FROM Documents;
When I add a text criteria to it and change back to datasheet view I get the Data Type mismatch error. Each of the fields referenced in the expression are text fields and the criteria I set is set in quotes so not sure why I'm getting this error.
Any ideas please?