Page 1 of 1

Expression to filter Date

Posted: Sun Jul 19, 2020 1:31 pm
by Bisoux
Hi,

I have a startDate field in a mysql database. This is a datetime datatype. I am trying to extract the year part using the year function on a filter on a databand. I want to then compare it to data entered by the user in the TYear variable and return the filtered records. For the year 2020 the user will enter 2020. The filter should give me all records prior to and including 2020. If I remove the filter I am getting all records, but if i put the below filter there are no records returned.

Code: Select all

Year(Reports.startDate) <= TYear
This is not working. Can you please tell me the way to do this?

Thank you

Re: Expression to filter Date

Posted: Tue Jul 21, 2020 7:04 am
by Lech Kulikowski
Hello,

Please check that the startDate column is DateTime.
Also, please check Reports.startDate.Year

Thank you.