Double validation

I have a MACHINERY table and a STATUS field (Active, Inactive); I need to record the daily activities in another table. In order not to duplicate a record I use the following expression in Valid_if:

COUNT (
SELECT (Daily machinery report [RDM ID],
AND ([CODE] = [_ THISROW]. [CODE],
[DATE] = [_ THISROW]. [DATE])
)
) = 0,

but I also need it to show me the CODE of the ACTIVE machines.

If I add to the previous expression AND (SELECT (Machinery [CODE, [STATUS] = โ€œACTIVEโ€), COUNT (
SELECT (Daily machinery report [RDM ID],
AND ([CODE] = [_ THISROW]. [CODE],
[DATE] = [_ THISROW]. [DATE])
)
) = 0), it gives me an error, what am I doing wrong?

Solved Solved
0 5 167
1 ACCEPTED SOLUTION

AND(

SELECT(

Machinery[CODE],

[STATUS] = โ€œACTIVEโ€

),

COUNT(

SELECT(Daily machinery report[RDM ID],

AND(

  [CODE]=[_THISROW].[CODE],

  [DATE]=[_ THISROW].[DATE]

)

)

)=0

)

View solution in original post

5 REPLIES 5
Top Labels in this Space