Hiya,
Just wondering if it’s possible to do something directly within a query.
Let’s say you have 100 entries, each of which have different expiration dates. What I want to do (which I do have working at the moment but I’m positive there must be a better way than I’ve done it with a lot of PHP in a template currently) is bring back the entries with regards to the expiration dates and place them in a table sorted and coloured such as this :
1 - If expiration date is within 1 month of now place these at the top of the table, sorted and coloured red.
2 - If expiration date is within 3 months of now place these after any red entries and colour those orange.
3,4,5 & 6 - Same sort of thing.
So the question is basically is it possible to bring back a load of results using one query and have them sorted in this way already and somehow marked so that I can colour code them easily?
Thanks for any help on this query gurus 😉
Best wishes,
Mark