.echo on
.headers on
.open ramdisk/aiox.db
.mode line
--Looking at today in progress which requires manual intervention
select *, round(-dEop_dischrToday + dEpv1_today + dEac_chrToday,1) rule1 from (select max(dt), strftime('%d', dt) as dom, round(max(Epv1_total) - min(Epv1_total),1) dEpv1_today, round(max(Eac_chrTotal) - min(Eac_chrTotal),1) dEac_chrToday, round(max(Eac_dischrTotal) - min(Eac_dischrTotal),1) dEac_dischrToday, round(max(Eop_dischrTotal) - min(Eop_dischrTotal),1) dEop_dischrToday, round(max(Ebat_dischrTotal) - min(Ebat_dischrTotal),1) dEbat_dischrToday from ir where date(dt) = (select date(dt, '-0 day') from ir order by dt desc limit 1)  );

