In that account I put every important events and info with zero amounts. If event is yearly a have marked it as Y in checknumber field.
The report returns yarly events from current date for year.
- Code: Select all
Select strftime('%d ',transdate)||m.month_name as "Дата", notes as "Описание" from
(select * from (select transdate, notes from checkingaccount_v1 c
where accountid=25 and transactionnumber='Y'
and strftime('%m-%d', transdate)>=strftime('%m-%d','now','localtime')
order by (strftime('%m%d',transdate)))
union all
select * from (select transdate, notes from checkingaccount_v1 c
where accountid=25 and transactionnumber='Y'
and strftime('%m-%d', transdate)<strftime('%m-%d','now','localtime')
order by (strftime('%m%d',transdate))
) )
left join (select 'январь' as month_name, 1 as month_id union select 'февраль', 2
union select 'март', 3 union select 'апрель', 4
union select 'май', 5 union select 'июнь',6
union select 'июль',7 union select 'август', 8
union select 'сентябрь', 9 union select 'октябрь', 10
union select 'ноябрь', 11 union select 'декабрь', 12) m
on m.month_id=round(strftime('%m',transdate))
