# Date Choice Issue: if-else Matching Problem

**URL:** <https://community.glideapps.com/t/date-choice-issue-if-else-matching-problem/71948>\
**Category:** Ask for Help\
**Created:** [March 23, 2024, 2:56am UTC](https://community.glideapps.com/t/date-choice-issue-if-else-matching-problem/71948 "2024-03-23T02:56:17Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)\
**Post date:** [March 23, 2024, 2:56am UTC](https://community.glideapps.com/t/date-choice-issue-if-else-matching-problem/71948/1 "2024-03-23T02:56:17Z")

</div>

Hello friends, this issue suddenly occurred, as it has been working fine until now, and I haven’t been able to determine the root cause. I have a table in a spreadsheet with many date columns, and in another table, I use transpose to combine these dates to be used as a list that I will use as options for the choice component.

Here, I only found a strange symptom when filling in the “Date Choice” using the choice component, the if-else matching does not work, but with manual input, the if-else column works as expected. With the description above, I hope it can be understood because it is very complex I did not elaborate on everything.

 ![Screenshot 2024-03-23 at 09.38.02](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/4/24fb5df583a7b9d3fa7187822de68c700268a9e6.png)

 ![Screenshot 2024-03-23 at 09.37.37](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/b/7b6b26d82fe7cb920c0a750b29d20817c5f5d8a2.png)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [March 23, 2024, 3:22am UTC](https://community.glideapps.com/t/date-choice-issue-if-else-matching-problem/71948/2 "2024-03-23T03:22:44Z")

</div>

My guess would be that your Dates also contain a time component, and as you’re trying to do exact comparisons with the if-then-else, you get inconsistent results.

In a case like this, I would convert all dates to integers in YYYYMMDD format using a math column, then use that in any subsequent matching logic.

---

<div class="post-metadata">

**Author:** ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)\
**Post date:** [March 23, 2024, 3:37am UTC](https://community.glideapps.com/t/date-choice-issue-if-else-matching-problem/71948/3 "2024-03-23T03:37:06Z")

</div>

I suspected as much. Can I do this formatting in the spreadsheet itself, as the number of columns will increase significantly if I add a math column (sorry for bargaining)? I’m still a bit curious because the source application I duplicated is still working fine, so I think it’s still possible to match the format.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [March 23, 2024, 3:59am UTC](https://community.glideapps.com/t/date-choice-issue-if-else-matching-problem/71948/4 "2024-03-23T03:59:45Z")

</div>

Up to you, do it however you want 🤷‍♂️

I would never recommend doing this in a connected spreadsheet, but it’s your choice 🙂

---

<div class="post-metadata">

**Author:** ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)\
**Post date:** [March 23, 2024, 4:11am UTC](https://community.glideapps.com/t/date-choice-issue-if-else-matching-problem/71948/5 "2024-03-23T04:11:21Z")

</div>

Yes, there is a difference. If I turn on Date&Time, it will display: Friday, 1 March 2024 at 12:00 and Friday, 1 March 2024 at 0:00. Does turning on only “Date” without “Time” still include the time in the matching?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [March 23, 2024, 4:12am UTC](https://community.glideapps.com/t/date-choice-issue-if-else-matching-problem/71948/6 "2024-03-23T04:12:42Z")

</div>

The display and formatting settings are just eye candy - they don’t change the underlying value.

---

<div class="post-metadata">

**Author:** ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)\
**Post date:** [March 23, 2024, 4:14am UTC](https://community.glideapps.com/t/date-choice-issue-if-else-matching-problem/71948/7 "2024-03-23T04:14:49Z")

</div>

Yes, I’ll try first. This is hard work. 🤒

---

<div class="post-metadata">

**Author:** ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)\
**Post date:** [March 23, 2024, 5:25am UTC](https://community.glideapps.com/t/date-choice-issue-if-else-matching-problem/71948/8 "2024-03-23T05:25:20Z")

</div>

I have found the issue and it is now working normally. The problem was when using the date-time picker component. I have now changed this component to just the date picker component. Thank you, Darren.

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [March 27, 2024, 2:47pm UTC](https://community.glideapps.com/t/date-choice-issue-if-else-matching-problem/71948/9 "2024-03-27T14:47:07Z")

</div>

> [@Himaladin](#):
>
> The problem was when using the date-time picker component. I have now changed this component to just the date picker component.

Just so you know, when you use the date picker or date-time picker, both a date and time will be saved in the value of the timestamp. The difference is that the date-time picker allows the user to be more granular with the time element, while the date picker will default to 00:00:00 (12 AM) on the chosen date.

---

<div class="post-metadata">

**Author:** ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)\
**Post date:** [March 27, 2024, 3:06pm UTC](https://community.glideapps.com/t/date-choice-issue-if-else-matching-problem/71948/10 "2024-03-27T15:06:52Z")

</div>

Yes Nathanael, the error is that if you use the Date&Time pickers, glide will make the default time 12.00am.  
In Gsheet, if I reference to another cell then the hour changes to 00.00. As a result, when conditioned it cannot be found.  
However, if I use Date Picker (without time), the data received in G Sheet is 00.00.  
Since in this context I only need the date, I just change it to “Date Picker”.  
Thank you for your attention.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [April 3, 2024, 3:07pm UTC](https://community.glideapps.com/t/date-choice-issue-if-else-matching-problem/71948/11 "2024-04-03T15:07:25Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
