Slice filter condition using timestamp to date comparison not working

Hi

This is the expression used for Slice filter condition.

The third condition is not working - a row that satisfy 3rd condition is not showing.

IFS (
   AND ( [Job Status] = "Activate", [Task Status] = "Ready" ), TRUE,
   AND ( [Job Status] = "Stop", [Task Status] = "Ready" ), TRUE,
   AND ( [Job Status] = "Complete", [OUT TS] =Today() ), TRUE,
)

[Job Status] - field type is Text - readonly field taken from google sheet

[Task Status] - field type is Text - readonly field taken from google sheet

[OUT TS] - field type is ChangeTimestamp -readonly field from appsheet timestamp

Google Sheet file locale is matching Appsheet table locale. Both are English (United States).

Below table data is from Row 7 that satisfy the 3rd condition where [OUT TS] is 5/7/2022 11:58:01 AM and today's date is 7 May 2022 (at the time of writing this question).

 
7 JO-HN22-0003 False Complete 5/7/2022 12:09:11 PM Released Grand Nutrition GHTK 14 Pieces 100,000 123456 All 5/7/2022 11:58:01 AM
 
I can't figure out what's wrong. Any help is much appreciated.    

 

Solved Solved
0 2 123
1 ACCEPTED SOLUTION

I believe you are getting error because you are comparing a datetime value [OUT TS]  with only date value, TODAY()

 You will need to cast the changetimestamp field from datetime type to only date type as below

IFS (
   AND ( [Job Status] = "Activate", [Task Status] = "Ready" ), TRUE,
   AND ( [Job Status] = "Stop", [Task Status] = "Ready" ), TRUE,
   AND ( [Job Status] = "Complete", DATE([OUT TS]) =Today() ), TRUE,
)

View solution in original post

2 REPLIES 2

I believe you are getting error because you are comparing a datetime value [OUT TS]  with only date value, TODAY()

 You will need to cast the changetimestamp field from datetime type to only date type as below

IFS (
   AND ( [Job Status] = "Activate", [Task Status] = "Ready" ), TRUE,
   AND ( [Job Status] = "Stop", [Task Status] = "Ready" ), TRUE,
   AND ( [Job Status] = "Complete", DATE([OUT TS]) =Today() ), TRUE,
)

Hi Suvrutt

Thank you, it works. Tore my hair out for half a day, saved by you! Thankfully, not bald yet!

@Aleksi Would be good to include this example - compare ChangeTimestamp vs Appsheet Dates somewhere in "Date and Time Expressions" page here https://help.appsheet.com/en/articles/961346-date-and-time-expressions

Cheers!

 

 

Top Labels in this Space