Skip to main content
June 26, 2021
Solved

How can we filter based on only month and day using queryFilter?

  • June 26, 2021
  • 4 replies
  • 0 views

Hello,

The data in my database is of form yyyy-mm-dd. While filtering data, I want to ignore the year. How can I do it?

Thanks.

Best answer by stefanhelzle0001

That is not possible out of the box. I suggest to implement a view in database which puts day, month and year into separate columns. Then you can filter on this. In case your data volume is large, consider performance tests.

4 replies

stefanhelzle0001
Brainy
June 26, 2021

That is not possible out of the box. I suggest to implement a view in database which puts day, month and year into separate columns. Then you can filter on this. In case your data volume is large, consider performance tests.

June 27, 2021

Thank you so much for the advice.

csteward
June 28, 2021

Note if the database side VIEW method is utilized on a datetime value, any DB-side calculations to return DAY, MONTH and YEAR separately will be done on those GMT values and may be incorrect depending on the time of day in the value, as Appian's time zone conversions are bypassed with this method.  To resolve this, we implemented the solution from mssqltips.com to convert GMT, with daylight savings, and it works great as we always report in Eastern time.  The datetime values are wrapped in that function call, within SQL's DATEPART() function.