# Relation will recognize a date match but not Query

**URL:** <https://community.glideapps.com/t/relation-will-recognize-a-date-match-but-not-query/74796>\
**Category:** Ask for Help\
**Created:** [July 10, 2024, 5:58pm UTC](https://community.glideapps.com/t/relation-will-recognize-a-date-match-but-not-query/74796 "2024-07-10T17:58:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![matt45](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/matt45/32/58759_2.png) [@matt45](https://community.glideapps.com/u/matt45)\
**Post date:** [July 10, 2024, 5:58pm UTC](https://community.glideapps.com/t/relation-will-recognize-a-date-match-but-not-query/74796/1 "2024-07-10T17:58:13Z")

</div>

I have problem that I’m trying to sort and I can’t tell if it is it a simple user error or a glitch.

I have a table of events called “Events” and then a table to log which volunteers signed up to do which role, when, etc called “Serve Log”.

In the Events table I set up a Query to match the date of an event with the Serve Log. I’m baffled why a Relation will find matches for all the dates in the events table but the Query will only find some and not others.

 ![Screenshot 2024-07-10 at 12.34.19 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/d/0d434a5a7fb7288739fff6461899fe04add3d03d.jpeg)

The fact that Relation finds matches tells me that the dates are formatted properly. Right? I can’t think of what else it could be. Here are how they are set up:

 ![Screenshot 2024-07-10 at 12.46.32 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/f/3f9fdd64cf5ab94c03128fbab37e85e27acd3bc0.jpeg)

 ![Screenshot 2024-07-10 at 12.47.13 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/f/df51c086303293a9439c87be3086fbd9c4605d5c.png)

I’d like to use a Query because I have conditions that I want to throw into the Query besides just matching the date. For now I am using the “rel\_Serve Log” column and querying that to get what I want:

 ![Screenshot 2024-07-10 at 12.50.44 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/b/2b9c9a905bf458ccd8e8b8a25ba8a873461685ec.jpeg)

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [July 10, 2024, 11:31pm UTC](https://community.glideapps.com/t/relation-will-recognize-a-date-match-but-not-query/74796/2 "2024-07-10T23:31:56Z")

</div>

I’m not sure what’s the reason for this behaviour, but I suggest creating numeric values for dates instead of relying on a date/time format. You can add a math column with this formula:

`YEAR(D)*10^4+MONTH(D)*10^2+DAY(D)` with D being the Date, to get a YYYYMMDD number.

Then proceed to do the query with it, and see if it returns the correct row(s).

---

<div class="post-metadata">

**Author:** ![Andrew\_Davies](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/andrew_davies/32/41838_2.png) [@Andrew\_Davies](https://community.glideapps.com/u/Andrew_Davies)\
**Post date:** [July 11, 2024, 7:34am UTC](https://community.glideapps.com/t/relation-will-recognize-a-date-match-but-not-query/74796/3 "2024-07-11T07:34:41Z")

</div>

That’s the second time I’ve seen this method for formatting a date as YYYY-MM-DD.

I normally use a Format date column (which uses Luxon formats)

Is there a reason why a Maths column is better or is it six and two threes?

---

<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:** [July 11, 2024, 9:29am UTC](https://community.glideapps.com/t/relation-will-recognize-a-date-match-but-not-query/74796/4 "2024-07-11T09:29:40Z")

</div>

The Format Date column is the work of satan. It will work perfectly 99.9% of the time, but that 0.1% when it breaks will do your head in. I do not use it, and I do not recommend using it.

The Math approach is a little more work, but is 100% reliable.

For more about why I don’t recommend the Format Date column, see below:

> [@Time Format](https://community.glideapps.com/t/time-format/50074/8):
>
> The other thing you need to do is test it at different times of the year. Early on, when I was trying to use it, I found that it would sometimes get the day and month mixed up, but only under certain circumstances, and only if the date was ambiguous. For example, today is September 25th. In the US, they write that as 9/25/2022. In the real world, we write it as 25/9/2022. But either way, it’s obvious that it’s September 25. It can’t be anything else, because there is no 25th month. But, le…

---

<div class="post-metadata">

**Author:** ![Andrew\_Davies](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/andrew_davies/32/41838_2.png) [@Andrew\_Davies](https://community.glideapps.com/u/Andrew_Davies)\
**Post date:** [July 11, 2024, 10:16am UTC](https://community.glideapps.com/t/relation-will-recognize-a-date-match-but-not-query/74796/5 "2024-07-11T10:16:03Z")

</div>

Poor Satan always gets a bad press!

I love it that approach using the Maths column. So clever! Maths never goes wrong.
