comparing time (european time-format) within if-expression

if have following expression: 

  
IF([DateTime] <= "15:00","true","false")
   
in table there are following entries (DateTime - european timeformat):

31.01.2022 05:16 (AM)
30.01.2022 14:36
30.01.2022 15:00
30.01.2022 15:36

  

the result of if-expression is always "false"

31.01.2022 05:16 >>> result: "false"
30.01.2022 14:36 >>> result: "false"
30.01.2022 15:00 >>> result: "false"
30.01.2022 15:36 >>> result: "false"

  

Question: how do i have to modify "if-expression" to get correct results:

expression: IF([DateTime] <= "???????","true","false")

(AM) 31.01.2022 05:16 >>> result: "true"
(PM) 30.01.2022 14:36 >>> result: "true"
(PM) 30.01.2022 15:00 >>> result: "true"
(PM) 30.01.2022 15:36 >>> result: "false"

many thanks in advance for any help!

Solved Solved
0 2 77
1 ACCEPTED SOLUTION

Please try with 

IF(TIME([DateTime]) <= "15:00","true","false")

You can even simplify further as  just

TIME([DateTime] <= "15:00")

The above comparison will anyway give you TRUE or FALSE result, so further IF() statement is not necessary.  Using IF() is like IF( "Result TRUE", TRUE, FALSE)

View solution in original post

2 REPLIES 2

Please try with 

IF(TIME([DateTime]) <= "15:00","true","false")

You can even simplify further as  just

TIME([DateTime] <= "15:00")

The above comparison will anyway give you TRUE or FALSE result, so further IF() statement is not necessary.  Using IF() is like IF( "Result TRUE", TRUE, FALSE)

hello  Suvrutt_Gurjar,

works perfect - thank you so much !!!

 

Top Labels in this Space