Hi Appsheet!
I have found this bug in my app that took me a lot of time to narrow down to this simple expression:
MIN(LIST([DateTime1], [DateTime2], [DateTime3])) = [DateTime1]
Here, I am comparing the value of the first DateTime stamp with a DateStamp column. It always returns TRUE.
I paraphrased the expression with this and the expression returns the desired output:
NOT(MIN(LIST([DateTime1], [DateTime2], [DateTime3])) <> [DateTime1])
I assume you already checked what just โMIN(LIST([DateTime1], [DateTime2], [DateTime3]))โ is actually returning? Might help to provide that info and what the value of DateTime1 actually is. If you are comparing a date vs datetime.
Ow sorry I made a typo. They are all DateTime values, there is no Date value in the expression.
[DateTime1] = โ3/21/2019 8:00:00โ
[DateTime1] = โ3/21/2019 7:59:00โ
[DateTime1] = โ3/21/2019 7:58:00โ
I was comparing if the earliest of the 3 DateTime values equate to the first DateTime value. Using the MIN() function, I tried to get the earliest DateTime value and then tried to compare to the first DateTime value.
The first expression was checking using the direct method of:
โIs earliest DateTime equal to the first DateTime value?โ
- This always returns TRUE, with whatever values I put in the 3 columns.
So I tried to reconstruct by wrapping the expression with NOT() and replaced the equal sign with not equal (<>).
โOpposite of the value given by (Is earliest DateTime not equal to the first DateTime value?)โ
- This now give me the logical value.
I hope I explained clearly
Does the following return the correct value?
min(list("3/21/2019 8:00:00", "3/21/2019 7:59:00", "3/21/2019 7:58:00"))
Hi @Steve
Yes min(list(โ3/21/2019 8:00:00โ, โ3/21/2019 7:59:00โ, โ3/21/2019 7:58:00โ)) returns the correct value. The error happens when the parameters are taken from column values and the equality sign is added to make a conditional test. One thing to note here is that when comparing DateTime values exclusively (ex. DateTime1 = DateTime2 ), the output is logically correct. However when applying the whole expression that uses MIN(), LIST() and equality sign (=), the output is always true.
I have some concern that your posts use the fancy quotation marks. In the past, Iโve noticed others have had problems using fancy quotes in expressions. You might try disabling โsmart quotesโ and replacing the ones already there with non-fancy ones.
Hi Steve!
I made the initiative of recreating the whole app project from scratch and the same expression works fine now. I do not know why the error still exists in the old app, but somehow the error does not bother in my new app anymore.
I hope you could help me in later concerns. Thank you
Ugh. Well, I too have had problems that were fixed by recreating the app. Iโm sorry it took that,
Are โDateTime stampโ and โDateStampโ the same thing?
Sorry I made a typo. They are all DateTime values. I meant โparaphrasedโ by reconstructing the expression. I used LIST() to construct a list of DateTime values, and MIN() to get the earliest DateTime from that list.
What does this mean?
And to be clear, MIN() used with chronological types returns the earliest/oldest value.
User | Count |
---|---|
40 | |
29 | |
22 | |
20 | |
15 |