got an idea from someone I was chatting to.
Basically pre-create a table that has every date over the years you're interested in. Then for each date create a column for each sorting arrangement you might want, e.g. day number, week number, month number etc. Then join the expenses table with this on date. Pretty cool...