You'll have to extract the day number first using one of the format datetime expressions as mentioned on https://world.mendix.com/display/refguide5/Parse+and+format+date+function+calls
Something like this (untested btw) :
https://modelshare.mendix.com/models/1362087d-f8ca-4e43-8cc7-5051f10907ac/format-and-retrieve-based-on-day-example
Since day of year is not really a thing you can query on, I would advise you to store this day as a number so you can easily query on it later. This can be done as some after-commit event or maybe in the microflow where you store this date. There you can extract the number of the day and just add that as a helper attribute. You can extract the day using the formatting functions described on https://world.mendix.com/display/refguide5/Parse+and+format+date+function+calls