04:00:00 is being interpreted as (12/30/1899 4:00:00 AM)

Sample data in column [NEW CASE DATE TIME] (datatype is DateTime): 

3/20/2024 4:29 PM
 
Intended outcome for the DateTime: True if [NEW CASE DATE TIME] - NOW() is greater than 4 hours

Script:

AND(
([NEW CASE DATE TIME] - NOW()) > "04:00:00",
ISBLANK([FE Acknowledgement]),
CONTEXT("View") = "EWO DASHBOARD"
)

Result:

ALL these statements are true: ....1: ((The value of column 'NEW CASE DATE TIME' - NOW( ....))) is greater than ("12/30/1899 4:00:00 AM") ....2: (The value of column 'FE Acknowledgement') is empty ....3: (CONTEXT( ........"View")) is equal to ("EWO DASHBOARD")

Solved Solved
0 3 73
1 ACCEPTED SOLUTION

Please try 

AND(
([NEW CASE DATE TIME] - NOW()) > "004:00:00",
ISBLANK([FE Acknowledgement]),
CONTEXT("View") = "EWO DASHBOARD"
)

 

Please note the extra 0 suggested in "004:00:00"

([NEW CASE DATE TIME] - NOW())  is subtraction between two date time values and as such computes duration. In AppSheet duration has an extra 0 to separate it from time value.

Since you mentioned "04:00:00" , it is considered time by AppSheet and since the comparison is for datetime value a default date of ""12/30/1899" is added.

Please refer the help article below and the expressions related to duration therein

Date and time expressions - AppSheet Help

Suvrutt_Gurjar_0-1710999977253.png

 

 

View solution in original post

3 REPLIES 3

Please try 

AND(
([NEW CASE DATE TIME] - NOW()) > "004:00:00",
ISBLANK([FE Acknowledgement]),
CONTEXT("View") = "EWO DASHBOARD"
)

 

Please note the extra 0 suggested in "004:00:00"

([NEW CASE DATE TIME] - NOW())  is subtraction between two date time values and as such computes duration. In AppSheet duration has an extra 0 to separate it from time value.

Since you mentioned "04:00:00" , it is considered time by AppSheet and since the comparison is for datetime value a default date of ""12/30/1899" is added.

Please refer the help article below and the expressions related to duration therein

Date and time expressions - AppSheet Help

Suvrutt_Gurjar_0-1710999977253.png

 

 

adding an extra 0 fixed it. Thanks. This is a new knowledge to me with handling hours in appsheet. Cheers!

Good to know it wirks. You are welcome.

Top Labels in this Space