[General Accessories] jlaunay:
Il had also corrected this but forgot to share.

In the file miband_eng.sql replace the following code :

select "[new Date(" ||strftime('%Y',Date)||","||strftime('%m',Date)||

with

Here is the whole file quickly translated in french :

.header on
.mode csv
.once extract.csv
select Date||" " as Date,LightSleepMin+DeepSleepMin as InBedMin,DeepSleepMin,LightSleepMin,SleepStart,SleepEnd,AwakeMin
,DailyDistanceMeter,DailySteps,DailyBurnCalories
,DailyDistanceMeter-RunDistanceMeter as WalkDistance,WalkTimeMin,DailyBurnCalories-RunBurnCalories as WalkBurnCalories
,RunDistanceMeter,RunTimeMin,RunBurnCalories from (
select date,summary
,cast(rtrim(substr(summary,instr(summary,'"lt":')+5,7),', "st":') as Integer) as LightSleepMin
,cast(rtrim(substr(summary,instr(summary,'"dp":')+5,7),', "ed":') as Integer) as DeepSleepMin
,cast(rtrim(substr(summary,instr(summary,'"wk":')+5,7),', "dp":') as Integer) as AwakeMin

,datetime(cast(rtrim(substr(summary,instr(summary,'"st":')+5,10),', "wk":') as Integer),'unixepoch','localtime') as SleepStart
,datetime(cast(rtrim(substr(summary,instr(summary,'"ed":')+5,10),', "v":') as Integer),'unixepoch','localtime') as SleepEnd

,cast(rtrim(substr(summary,instr(summary,'"rn":')+5,7),', "cal"') as Integer) as RunTimeMin
,cast(rtrim(substr(summary,instr(summary,'"runDist":')+10,7),', "wk":') as Integer) as RunDistanceMeter
,cast(rtrim(substr(summary,instr(summary,'"runCal":')+9,7),', "dis"') as Integer) as RunBurnCalories

,cast(rtrim(substr(substr(summary,instr(summary,'"wk":')+5),instr(substr(summary,instr(summary,'"wk":')+5),'"wk":')+5,7),', "ttl"') as Integer) as WalkTimeMin
,cast(rtrim(substr(summary,instr(summary,'"ttl":')+6,7),', "runC') as Integer) as DailySteps
,cast(rtrim(substr(summary,instr(summary,'"dis":')+6,7),'}}') as Integer) as DailyDistanceMeter
,cast(rtrim(substr(summary,instr(summary,'"cal":')+6,4),', "runD') as Integer) as DailyBurnCalories
from date_data ) order by date;

--cast(SleepStart as text)||","||cast(SleepEnd as text)||","||

.header off
.mode list
.output extract.js
.print "var data = new google.visualization.DataTable();

.print "data.addColumn('date','Date_____', 'date');"
.print "data.addColumn('number','Année', 'year');"
.print "data.addColumn('string','Année-Mois', 'yearmonth');"
.print "data.addColumn('number','Mois', 'month');"
.print "data.addColumn('string','Année-Semaine', 'yearweek');"
.print "data.addColumn('number','Semaine', 'week');"
.print "data.addColumn('number','Jour de la semaine', 'dayofweek');"
.print "data.addColumn('number','Jour', 'day');"
.print "data.addColumn('number','Total Sommeil, mins', 'InBedMin'); "
.print "data.addColumn('number','Sommeil Profond, mins', 'DeepSleepMin');"
.print "data.addColumn('number','Sommeil Léger, mins', 'LightSleepMin');"
.print "data.addColumn('number','Réveillé, mins', 'AwakeMin');"

.print "data.addColumn('number','Distance journalière mètres', 'DailyDistanceMeter');"
.print "data.addColumn('number','Pas quotidien', 'DailySteps');"
.print "data.addColumn('number','Cal. brulées ce jour', 'DailyBurnCalories');"
.print "data.addColumn('number','Distance de marche, metres', 'WalkDistance');"
.print "data.addColumn('number','Temps de marche, minutes', 'WalkTimeMin');"
.print "data.addColumn('number','Cal. brulées en marchant', 'WalkBurnCalories');"
.print "data.addColumn('number','Distance en courant, meters', 'RunDistanceMeter');"
.print "data.addColumn('number','Temps à courir, minutes', 'RunTimeMin');"
.print "data.addColumn('number','Cal. brulées en courant', 'RunBurnCalories');"
.print "data.addColumn('number','SleepStartOffset', 'SleepStartOffset');"
.print "data.addColumn('number','SleepEndOffset', 'SleepEndOffset');"
.print "data.addRows([ "
select "[new Date(" ||strftime('%Y',Date)||","||case strftime('%m', Date) when '01' then '0' when '02' then '1' when '03' then '2' when '04' then '3' when '05' then '4' when '06' then '5' when '07' then '6' when '08' then '7' when '09' then '8' when '10' then '9' when '11' then '10' when '12' then '11' else '' end||","|| strftime('%d',Date) ||"),"|| strftime('%Y',Date)||","""||strftime('%Y-%m',Date)||""","||strftime('%m',Date)||","""||strftime('%Y-%W',Date)||""","||strftime('%W',Date)||","||strftime('%w',Date)
||","||strftime('%d',Date)||","||cast(LightSleepMin+DeepSleepMin as text)||","||cast(DeepSleepMin as text)||","||cast(LightSleepMin as text)||","||
cast(AwakeMin as text)||","||cast(DailyDistanceMeter as text)||","||cast(DailySteps as text)||","||cast(DailyBurnCalories as text)||","||
cast(DailyDistanceMeter-RunDistanceMeter as text)||","||cast(WalkTimeMin as text)||","||cast(DailyBurnCalories-RunBurnCalories as text)||","||
cast(RunDistanceMeter as text)||","||cast(RunTimeMin as text)||","||cast(RunBurnCalories as text)||","||
cast((strftime('%s',SleepStart)-strftime('%s',date))/60 as text)||","||cast((strftime('%s',SleepEnd)-strftime('%s',date))/60 as text)
||"]"||case when date = (select max(date) from date_data) then "" else "," end
from (
select id,date,summary
,cast(rtrim(substr(summary,instr(summary,'"lt":')+5,7),', "st":') as Integer) as LightSleepMin
,cast(rtrim(substr(summary,instr(summary,'"dp":')+5,7),', "ed":') as Integer) as DeepSleepMin
,cast(rtrim(substr(summary,instr(summary,'"wk":')+5,7),', "dp":') as Integer) as AwakeMin

,datetime(cast(rtrim(substr(summary,instr(summary,'"st":')+5,10),', "wk":') as Integer),'unixepoch','localtime') as SleepStart
,datetime(cast(rtrim(substr(summary,instr(summary,'"ed":')+5,10),', "v":') as Integer),'unixepoch','localtime') as SleepEnd

,cast(rtrim(substr(summary,instr(summary,'"rn":')+5,7),', "cal"') as Integer) as RunTimeMin
,cast(rtrim(substr(summary,instr(summary,'"runDist":')+10,7),', "wk":') as Integer) as RunDistanceMeter
,cast(rtrim(substr(summary,instr(summary,'"runCal":')+9,7),', "dis"') as Integer) as RunBurnCalories

,cast(rtrim(substr(substr(summary,instr(summary,'"wk":')+5),instr(substr(summary,instr(summary,'"wk":')+5),'"wk":')+5,7),', "ttl"') as Integer) as WalkTimeMin
,cast(rtrim(substr(summary,instr(summary,'"ttl":')+6,7),', "runC') as Integer) as DailySteps
,cast(rtrim(substr(summary,instr(summary,'"dis":')+6,7),'}}') as Integer) as DailyDistanceMeter
,cast(rtrim(substr(summary,instr(summary,'"cal":')+6,4),', "runD') as Integer) as DailyBurnCalories
from date_data ) order by date;
.print ]);

--ATTACH DATABASE "db\user-db" AS user;
--.header on
--.mode csv
--.once log.csv
--select date || ' ' || time as date, text1, text2 from user.[LUA_LIST] where [INDEX] is null;