# Compare TimeOnly column with SingleValue column (TimeOnly) doesn't works

**URL:** <https://community.glideapps.com/t/compare-timeonly-column-with-singlevalue-column-timeonly-doesnt-works/63646>\
**Category:** Ask for Help\
**Created:** [July 7, 2023, 6:46pm UTC](https://community.glideapps.com/t/compare-timeonly-column-with-singlevalue-column-timeonly-doesnt-works/63646 "2023-07-07T18:46:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![TeamDigitale](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/teamdigitale/32/13473_2.png) [@TeamDigitale](https://community.glideapps.com/u/TeamDigitale)\
**Post date:** [July 7, 2023, 6:46pm UTC](https://community.glideapps.com/t/compare-timeonly-column-with-singlevalue-column-timeonly-doesnt-works/63646/1 "2023-07-07T18:46:49Z")

</div>

Hi, i have a table wit a TimeOnly Column and i get the first value using a Single Value column.  
All works fine until i try to using an ITE column to compare this value with another value in another table that is a TimeOnly column  
None of comparision logic like On or Before, On or After works  
What am i wrong ?  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [July 7, 2023, 7:10pm UTC](https://community.glideapps.com/t/compare-timeonly-column-with-singlevalue-column-timeonly-doesnt-works/63646/2 "2023-07-07T19:10:24Z")

</div>

The comparison logic is available but doesn’t work…or do you mean it’s not available?

---

<div class="post-metadata">

**Author:** ![TeamDigitale](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/teamdigitale/32/13473_2.png) [@TeamDigitale](https://community.glideapps.com/u/TeamDigitale)\
**Post date:** [July 7, 2023, 7:17pm UTC](https://community.glideapps.com/t/compare-timeonly-column-with-singlevalue-column-timeonly-doesnt-works/63646/3 "2023-07-07T19:17:35Z")

</div>

No, seems doesn’t works.  
If i have the valule of a = 3:00 in the timecolum and the value of b = 3:30 in SingleValue column the operator “a before b” works fine and return true  
But If i have the valule of a= 4:00 in the timecolum and the value of b= 3:30 in SingleValue column the operator “a on or before b” also and return true.  
Is this correct ?  
How can i implement the conditions that a time is less or equal another time ?  
I would like to have that if a = 3.00 and b= 3.30 return true and also return true if a = 3.30 and b=3:30  
Thanks again

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [July 7, 2023, 7:41pm UTC](https://community.glideapps.com/t/compare-timeonly-column-with-singlevalue-column-timeonly-doesnt-works/63646/4 "2023-07-07T19:41:36Z")

</div>

There is usually an underlying date. If you double click on the cell in the data editor, what do you see? You may be comparing two completely different dates.

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [July 7, 2023, 7:47pm UTC](https://community.glideapps.com/t/compare-timeonly-column-with-singlevalue-column-timeonly-doesnt-works/63646/5 "2023-07-07T19:47:30Z")

</div>

Hola!

I think your problem comes from your TimeOnly Column.

It has an internal date and time (e.g. Jul 7, 2023 at 3:00), but the format previously set in the Glide editor only allows you to see its time (3:00).

Therefore, your ITE column is comparing a Text (“3:00”) retrieved by your SingleValue column with a date Value (Jul 7, 2023 at 3:00) and that is wrong.

Both values must be text or have a date.

Saludos!

---

<div class="post-metadata">

**Author:** ![TeamDigitale](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/teamdigitale/32/13473_2.png) [@TeamDigitale](https://community.glideapps.com/u/TeamDigitale)\
**Post date:** [July 7, 2023, 8:38pm UTC](https://community.glideapps.com/t/compare-timeonly-column-with-singlevalue-column-timeonly-doesnt-works/63646/6 "2023-07-07T20:38:46Z")

</div>

Hi, thanks for the reply and you are right.  
I tried this before, but if i convert the TIME as text, i swap a problem with another because 10:30 is before 8:00 since “1” is less than “8” (as text value) and so it doesn’t works again  
Thanks a lot

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [July 7, 2023, 9:02pm UTC](https://community.glideapps.com/t/compare-timeonly-column-with-singlevalue-column-timeonly-doesnt-works/63646/7 "2023-07-07T21:02:07Z")

</div>

> [@TeamDigitale](#):
>
> a problem with another because 10:30 is before 8:00 since “1” is less than “8” (as text value) and so it doesn’t works again  
> Thanks a lot

Right!

The easy and lazy solution is to use the **“HH” format** for the hours, with this, your hours will look like “00, 01, 02, 03, … 22, 23” and any comparison will be done correctly.

The Format Date plugin can help you with this.

Feliz día!

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [July 7, 2023, 9:04pm UTC](https://community.glideapps.com/t/compare-timeonly-column-with-singlevalue-column-timeonly-doesnt-works/63646/8 "2023-07-07T21:04:47Z")

</div>

One thing I would do is use a math column to convert the hour and minute into a number.

`HOUR(Time)*100+MINUTE(Time)`

Then you have a true number to use for comparisons instead of text.
