Page 1 of 1

filtering on dates

Posted: 2022-03-07 14:41
by angus
Hello everyone, I have a field in my table called 'Date' and people are filtering on this ok. what I want is to create another filter field based on this date but the user only searches on the month.

I added the following into the _view.php page.

Code: Select all

"date_format(`PlannedGames`.`Date`,'%M%Y')" => "MMMYYYY",
Unfortunately this isn't working.

when I use just the month and filter Date like Feb it works ok. but not when I add the year, any idea?

Code: Select all

"date_format(`PlannedGames`.`Date`,'%M')" => "MMM",

Re: filtering on dates

Posted: 2022-03-11 21:44
by angus
I found the issue, %M is for the full month and not the 3 letter month like APR for April. I changed it to

Code: Select all

"date_format(`PlannedGames`.`Date`,'%m%Y')" => "MMMYYYY",


and I can search by 042022 now.