Hi Klas,
thanks for the quick reply.
I changed the query this way:
SELECT DISTINCT YEAR (publish_up) as value FROM #__content WHERE catid IN ( 16, 17, 18, 19 ) ORDER BY publish_up DESC
I also had to change the storage of my custom field to publish_up column.
Now the search works as expected.
Thank you
Luca