Error if date is between or same than a column

Hi guys, i have a problem to validate an datetime

i need to only accept and datetime if the value is different than the interval value from column AGENDA and PREVISÃO DE TÉRMINO

Example:
there is a value in a row with agenda = 24/04/2020 10:00 and Previsão de Término = 24/04/2020 20:100
So the new value to agenda must be lower or greater(or diferent) than these interval, like:
24/04/2020 09:59 (09:59 a.m) or 24/04/2020 20:01 (08:01 p.m)

Try as the Valid If expression:

OR(
  ([_THIS] < [agenda]),
  ([_THIS] > [Previsão de Término])
)

Does not work.
It is giving error when I put any value in [agenda].

I did not mention that the value of the [agenda] column varies according to the technical column (Montador).

I thought of the expression:

IF (
[_ THISROW]. [MONTADOR] = [MONTADOR],
(OR( ([_THIS] < [agenda]), ([THIS] > [Previsão de Término]))), [ THIS]
)

But in the expression valid IF is not accepted

Please provide a screenshot of the error.

Please provide a screenshot of the error.

ANY VALUE SHOWS THIS MESSAGE

What comes close to what I want is:

in the Valid IF expression:

NOT(
IN ([_ this],
select(
geral[AGENDA], AND([_ thisrow].[MONTADOR] = [MONTADOR]
)
)
)
)

But this expression blocks only identical entries from [AGENDA] already registered.

I want to block all entries between [AGENDA] and [PREVISÃO DE TÉRMINO]

So the value of agenda in the form is only valid if it does not fall within the time spans between agenda and Previsão de Término of any rows of the geral table that have the same montador column value as that in the form? Try:

ISBLANK(
  FILTER(
    "geral",
    AND(
      ([_THISROW].[montador] = [montador]),
      ([_THISROW].[agenda] >= [agenda]),
      ([_THISROW].[agenda] <= [Previsão de Término]),
    )
  )
)
2 Likes

I was about to say it didn’t work, but I removed that last comma and it worked.:smile: :100:

thank you

1 Like

Whoops! My mistake, and good catch on your part! I’m glad it worked for you!

1 Like