moneymanagerex / general-reports

Bunch of general reports for Money Manager Ex
http://moneymanagerex.org/
MIT License
72 stars 47 forks source link

Invalid end_date value for 'Over Time' period #90

Open pleskava opened 5 months ago

pleskava commented 5 months ago

end_date for the query is null if &end_date' = '9999-12-31' (Over Time period)

WITH PeriodSelection as (
     select date('&begin_date', 'start of month') begin_date
         , date('&end_date', 'start of month', '+1 month', '-1 day') end_date
 )

Please, replace by

WITH PeriodSelection as (
     select date('&begin_date', 'start of month') begin_date
         IIF(date('&end_date') > date('9999-12-30') , date('9999-12-31'),  date('&end_date', 'start of month', '+1 month', '-1 day') )  end_date
 )

or change max value of period.