Filter in pdoResources

Summary

I have a few resources with dates, I want them to be displayed by month so for example.
2022-01-20 16:30:00
2022-02-10 16:30:00
2022-02-10 14:30:00

Date is a nomal TV width date. it also incl time as I am also using it else where.

I need to group them by month hence as above it would be 1x Jan and 2x Feb

Hence I want to do it using a where with json in pdoResources e.g.

[[pdoResources?
&parents=1
&depth=1
&tpl=groupMonthTpl
&includeTVs=etimdate
&where={etimdate:Feb}
]]

Now I am not sure what is suppose to go in the where statement as it needs to be as follows

[[+etimdate:date=%m:is=01:then=Its a JAN Date]]

but how do I get the above statement into where?

Or do I use &tplCondition

for tthat and write the above into that chunk?
is there an example of this?

Dates in a TV are stored as strings in the database, so you probably can get away with a LIKE condition like this:

[[pdoResources?
    ...
    &tvFilters=`etimdate==%-02-%`
]]

This should return only resources where etimdate is in february.

many thanks I was actually busy playing with the filters. learning a new thing every day…

tvfilters works :slight_smile:

Here is another solution that seems to work with pdoResources as well.

[[pdoResources?
    ...
    &where=`["MONTH(etimdate) = 2"]`
]]

ah awesome that was the one I wanted to do initially but I did not know how to format that as I could not find any documentation.

 &where=`["MONTH(etimdate) = 2"]

:grinning: