I need to validate two fields so as not to duplicate the record

I have a table for the daily report of the state of machinery; to avoid duplicating a record I need to validate the date and the machine code, I used this condition but it doesn’t work for me, what am I doing wrong?

AND(COUNT(SELECT(Machinery daily report[ID RDM],[CODE]=[_THISROW].[CODE]))=0, COUNT(SELECT(Machinery daily report[ID RDM],[DATE]=[_THISROW].[DATE]))=0)

Do only one COUNT( SELECT()), and use the AND() in the SELECT’s condition.

Also, ISBLANK() is roughly equivalent to COUNT()=0, and is arguable easier to read and cleaner code.


Thanks Marc

1 Like