# Formatted date not being recognized in a Query column as a date

**URL:** <https://community.glideapps.com/t/formatted-date-not-being-recognized-in-a-query-column-as-a-date/64672>\
**Category:** Ask for Help\
**Created:** [August 3, 2023, 5:07pm UTC](https://community.glideapps.com/t/formatted-date-not-being-recognized-in-a-query-column-as-a-date/64672 "2023-08-03T17:07:55Z")\
**Posts on this page:** 7\
**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:** [August 3, 2023, 5:07pm UTC](https://community.glideapps.com/t/formatted-date-not-being-recognized-in-a-query-column-as-a-date/64672/1 "2023-08-03T17:07:56Z")

</div>

I have a Template column that produces a date which I want to use as a filter in a Query, however the Query doesn’t recognize it as a date. Any recommendations?

Template pulls a date from a User-Specific date column.

 ![Screenshot 2023-08-03 at 11.42.29 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/e/1e187e3bbd64e610742c75d0c8a12fcd3ee498ee.jpeg)

After the first failed attempt of the query not recognizing the template date I used a Text to Date to see if I needed to format the value.

 ![Screenshot 2023-08-03 at 11.42.51 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/b/ebf12104a1bc42c68e4a737d49f478ad551293bb.jpeg)

Even still the Query doesn’t recognize the value a date.

 ![Screenshot 2023-08-03 at 11.44.43 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/7/0708dc6fd4be894fb3ae538c838b8156a4dc7dd1.jpeg)

---

<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:** [August 3, 2023, 5:21pm UTC](https://community.glideapps.com/t/formatted-date-not-being-recognized-in-a-query-column-as-a-date/64672/2 "2023-08-03T17:21:24Z")

</div>

> [@matt45](#):
>
> Template pulls a date from a User-Specific date column.

I would probably use a single value column over a template column because a template column is always going to return a text string value.

> [@matt45](#):
>
> After the first failed attempt of the query not recognizing the template date I used a Text to Date to see if I needed to format the value.

Your screenshot shows that you are using a Format Date column as opposed to a Text to Date column. Format Date is probably still returning a text string whereas Text to Date might return an actual datetime value.

---

<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:** [August 4, 2023, 1:14am UTC](https://community.glideapps.com/t/formatted-date-not-being-recognized-in-a-query-column-as-a-date/64672/3 "2023-08-04T01:14:51Z")

</div>

> [@matt45](#):
>
> Template pulls a date from a User-Specific date column.

How are you letting the users enter this piece of info?

Can you describe us about your use case? Can’t you just use the user profiles column in the query?

---

<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:** [August 4, 2023, 4:34am UTC](https://community.glideapps.com/t/formatted-date-not-being-recognized-in-a-query-column-as-a-date/64672/4 "2023-08-04T04:34:03Z")

</div>

Ah yes you’re correct, when I try to use a Text to Date it returns an empty value. I just put the template column and current time into a Date Difference column and it returned the proper value, so that tells me the template column is putting out an actual date value.

How would I set up a single value column? The dates are in my user profiles table. I’m pretty new to single value columns and don’t quite know how to utilize them.

---

<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:** [August 4, 2023, 4:55am UTC](https://community.glideapps.com/t/formatted-date-not-being-recognized-in-a-query-column-as-a-date/64672/5 "2023-08-04T04:55:17Z")

</div>

> [@matt45](#):
>
> How would I set up a single value column?

Actually a single value column won’t work in this particular case, but @ThinhDinh made a good point. Why are you trying to get the date into a template column when you can just use it directly from the user profile within the Query column.

> [@matt45](#):
>
> Text to Date it returns an empty value

This is irrelevant because I don’t think this is the right approach, but regarding this, did you specify the format of the date coming from the template column? It should be similar to how you configured the Format Date column, but opposite.

---

<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:** [August 4, 2023, 5:47am UTC](https://community.glideapps.com/t/formatted-date-not-being-recognized-in-a-query-column-as-a-date/64672/6 "2023-08-04T05:47:58Z")

</div>

I still haven’t found a solution to the posted issue, but I found a more efficient way to achieve what I wanted.

I’m using a Date Difference column with the week the progress report was submitted and the Date Picker. And then I have a Date Difference for the week of the progress report and current date. So then in the query the date diff of the week of the progress report is less than or equal to the date diff of the date picker.

---

<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:** [August 4, 2023, 12:21pm UTC](https://community.glideapps.com/t/formatted-date-not-being-recognized-in-a-query-column-as-a-date/64672/7 "2023-08-04T12:21:11Z")

</div>

Another consideration is to convert your dates into numbers.

For example:  
`YEAR(Date)*10000+MONTH(Date)*100+DAY(Date)`  
to get a number in YYYYMMDD format which is easy to use to compare as a number.

Or, if you are looking for week comparisons, this would work too.  
`YEAR(Date)*100+WEEKNUM(Date)`  
which gives you number in YYYYWW format.
