EXTRACTDATES() infers prior year instead of current year?

According to the EXTRACTDATES() documentation, when faced with a text date without a year, EXTRACTDATES() should supply the date with the *current* year.  I have text dates in a data set that look like this:

28 JUL 10:00 AM CDT

When use the EXTRACTDATES() function on this field, it consistently (always) returns:

7/28/2022

When I would expect it to return: 7/28/2023.  Thoughts?

Solved Solved
0 5 221
1 ACCEPTED SOLUTION

Your observation on 28th July is correct.

The below mentioned observation is not a solution to your query. But just sharing the results of the testing I did. The results are interesting and in line with the hunch I had. Again I am just sharing the test results. Please feel free to contact AppSheet team if you feel it is a bug. I think the implementation of such edge cases depends on what thought process the developers had. It should of course be in line with majority of use cases.

The results show that if the date /month is less than today's date and month, the year extracted is current year (2023)  and for the dates greater than or equal to today's date and month, the year extracted is previous year.

11 August

Suvrutt_Gurjar_0-1689263190122.png

11 April

Suvrutt_Gurjar_1-1689263263581.png

12 July

Suvrutt_Gurjar_2-1689263394185.png

13 July

Suvrutt_Gurjar_3-1689263495940.png

 

 

 

View solution in original post

5 REPLIES 5

 By the way, I'm currently dealing with this by adding +365 to the end of the expression to get it to display with this year, but this seems like a glitch and I'm concerned that if/when it gets corrected, my expression will then by off by a year.

Your observation on 28th July is correct.

The below mentioned observation is not a solution to your query. But just sharing the results of the testing I did. The results are interesting and in line with the hunch I had. Again I am just sharing the test results. Please feel free to contact AppSheet team if you feel it is a bug. I think the implementation of such edge cases depends on what thought process the developers had. It should of course be in line with majority of use cases.

The results show that if the date /month is less than today's date and month, the year extracted is current year (2023)  and for the dates greater than or equal to today's date and month, the year extracted is previous year.

11 August

Suvrutt_Gurjar_0-1689263190122.png

11 April

Suvrutt_Gurjar_1-1689263263581.png

12 July

Suvrutt_Gurjar_2-1689263394185.png

13 July

Suvrutt_Gurjar_3-1689263495940.png

 

 

 

Thanks for the testing.  I can see that, depending on the particular use case/situation, it defaulting to one year or the other might be considered beneficial.  So my solution should be fine because these dates will always be in the future in my use case.  The documentation states that it always defaults to the *current* year, and makes no mention of the date's relative position to today's date.  So perhaps it's the documentation that requires some additional explanation/nuance?  @Steve I know you've updated documentation in the past when it was needed...?  Thanks!

You are welcome. Yes, I think this point could be added in the documentation. Currently @lizlynch looks after the documentation.

@lizlynch : Request you to evaluate and  modify the the documentation in line with the observations in this post above.

@Suvrutt_Gurjar Thank you for the ping and for investigating this issue. Just want to run this by the AppSheet dev team before implementing a documentation update to confirm that there are no caveats to what you discovered during testing. Really appreciate your help! Will get the docs updated soon.

Top Labels in this Space