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)

Solved Solved
0 9 223
1 ACCEPTED SOLUTION

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]),
    )
  )
)

View solution in original post

9 REPLIES 9

Steve
Platinum 4
Platinum 4

Try as the Valid If expression:

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

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

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).

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]),
    )
  )
)

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

thank you

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

Top Labels in this Space