So if you want the running total as well as daily total, you would add a UNION select query, then in the function node that creates the text, add the new data.
example
[{"id":"5bc4fcf5.332164","type":"subflow","name":"Subflow 1","info":"","category":"","in":[{"x":60,"y":80,"wires":[{"id":"2c29ca9d.1f3726"}]}],"out":[{"x":920,"y":100,"wires":[{"id":"26fe58d.da0d2a8","port":0}]},{"x":540,"y":120,"wires":[{"id":"c3cccc67.eba87","port":0}]}]},{"id":"2c29ca9d.1f3726","type":"function","z":"5bc4fcf5.332164","name":"","func":"\nreturn msg;","outputs":1,"noerr":0,"x":200,"y":80,"wires":[["c3cccc67.eba87","dc32c467.fb1168"]]},{"id":"dc32c467.fb1168","type":"switch","z":"5bc4fcf5.332164","name":"allow only 1 ","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":390,"y":80,"wires":[["90e7351e.a17e68"],["54e68c10.45d2f4"]]},{"id":"c3cccc67.eba87","type":"trigger","z":"5bc4fcf5.332164","name":"","op1":"","op2":"Kapı 30 saniyedir aƧık!!","op1type":"nul","op2type":"str","duration":"30","extend":false,"units":"s","reset":"1","bytopic":"all","outputs":1,"x":390,"y":120,"wires":[[]]},{"id":"90e7351e.a17e68","type":"change","z":"5bc4fcf5.332164","name":"High","rules":[{"t":"set","p":"bc","pt":"msg","to":"orange","tot":"str"},{"t":"set","p":"status","pt":"msg","to":"High","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":80,"wires":[["26fe58d.da0d2a8"]]},{"id":"54e68c10.45d2f4","type":"change","z":"5bc4fcf5.332164","name":"Low","rules":[{"t":"set","p":"bc","pt":"msg","to":"purple","tot":"str"},{"t":"set","p":"status","pt":"msg","to":"Low","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":120,"wires":[["26fe58d.da0d2a8"]]},{"id":"26fe58d.da0d2a8","type":"function","z":"5bc4fcf5.332164","name":"","func":"\nreturn msg;","outputs":1,"noerr":0,"x":780,"y":100,"wires":[[]]},{"id":"d52360b0.ead3a8","type":"inject","z":"bf9e1e33.030598","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":150,"y":40,"wires":[["ff139c0b.e36ae"]]},{"id":"ff139c0b.e36ae","type":"subflow:5bc4fcf5.332164","z":"bf9e1e33.030598","name":"Pin Status Monitoring","x":190,"y":160,"wires":[["91e23c95.15301","1d6f36a.a6be3c9"],["dab16c7.a756e9"]]},{"id":"91e23c95.15301","type":"ui_button","z":"bf9e1e33.030598","name":"","group":"c55d32a2.85a79","order":9,"width":"6","height":"2","passthru":false,"label":"B5 Gate - 1 {{msg.status}}","color":"","bgcolor":"{{bc}}","icon":"","payload":"1","payloadType":"num","topic":"topic","x":280,"y":200,"wires":[[]]},{"id":"1d6f36a.a6be3c9","type":"switch","z":"bf9e1e33.030598","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"1","vt":"num"}],"checkall":"false","repair":false,"outputs":2,"x":310,"y":100,"wires":[["e89f92bb.1d0d"],["8f46e8cc.90b418"]]},{"id":"dab16c7.a756e9","type":"ui_toast","z":"bf9e1e33.030598","position":"dialog","displayTime":"","highlight":"","outputs":1,"ok":"OK","cancel":"","topic":"Uyarı","name":"","x":240,"y":240,"wires":[[]]},{"id":"5934b4d1.c2f46c","type":"inject","z":"bf9e1e33.030598","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":130,"y":100,"wires":[["ff139c0b.e36ae"]]},{"id":"e89f92bb.1d0d","type":"change","z":"bf9e1e33.030598","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"date"},{"t":"set","p":"topic","pt":"msg","to":"ontime","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":80,"wires":[["584ad012.78b8c"]]},{"id":"8f46e8cc.90b418","type":"change","z":"bf9e1e33.030598","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"date"},{"t":"set","p":"topic","pt":"msg","to":"offtime","tot":"str"},{"t":"set","p":"complete","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":120,"wires":[["584ad012.78b8c"]]},{"id":"584ad012.78b8c","type":"join","z":"bf9e1e33.030598","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":640,"y":100,"wires":[["407d6990.6658e8"]]},{"id":"407d6990.6658e8","type":"function","z":"bf9e1e33.030598","name":"","func":"msg.times = msg.payload\nmsg.times.date = new Date().toISOString().split(\"T\")[0];\nreturn msg;","outputs":1,"noerr":0,"x":480,"y":160,"wires":[["8e61d72d.1e6398"]]},{"id":"8e61d72d.1e6398","type":"template","z":"bf9e1e33.030598","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT\n sum(duration) AS total\nFROM\n sensor_durumu\nWHERE\n date = '{{times.date}}'\nUNION\nSELECT\n sum(duration) AS full_total\nFROM\n sensor_durumu\n","output":"str","x":480,"y":200,"wires":[["6f7dc943.52a3c8"]]},{"id":"6f7dc943.52a3c8","type":"function","z":"bf9e1e33.030598","name":"simulate sqllite query result","func":"msg.payload = [{\"total\":64,\"full_total\":700}];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":530,"y":240,"wires":[["42bf5b48.03ac14","d6c0f7f6.2e2508"]],"icon":"node-red/watch.svg"},{"id":"42bf5b48.03ac14","type":"function","z":"bf9e1e33.030598","name":"","func":"msg.total = msg.payload[0].total;\nmsg.full_total = msg.payload[0].full_total;\nmsg.payload = (msg.times.offtime - msg.times.ontime)/1000;\nmsg.total += msg.payload;\nmsg.full_total += msg.payload;\nmsg.title = \"Pin High Status \" + msg.times.date + \" Total : \" + msg.total +\n \"<br> Full Total : \" + msg.full_total;\nmsg.topic = \"Pin high (sn)\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":780,"y":240,"wires":[["de3e88a3.845d48","89fe727d.5d879","c1bcb080.c2ad9"]]},{"id":"d6c0f7f6.2e2508","type":"debug","z":"bf9e1e33.030598","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":720,"y":200,"wires":[]},{"id":"de3e88a3.845d48","type":"debug","z":"bf9e1e33.030598","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":880,"y":120,"wires":[]},{"id":"89fe727d.5d879","type":"ui_text","z":"bf9e1e33.030598","group":"8af25296.497b5","order":0,"width":"6","height":"2","name":"","label":"{{msg.title}}","format":"","layout":"row-spread","x":970,"y":200,"wires":[]},{"id":"c1bcb080.c2ad9","type":"template","z":"bf9e1e33.030598","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO sensor_durumu (date, ontime, offtime , duration ) VALUES ('{{times.date}}', {{times.ontime}}, {{times.offtime}}, {{payload}});","output":"str","x":930,"y":300,"wires":[["5c87710a.2786a","b126e467.8d9218"]]},{"id":"5c87710a.2786a","type":"function","z":"bf9e1e33.030598","name":"simulate db node to store the new row","func":"\nreturn msg;","outputs":1,"noerr":0,"x":1200,"y":300,"wires":[[]],"icon":"node-red/watch.svg"},{"id":"b126e467.8d9218","type":"debug","z":"bf9e1e33.030598","name":"store in db","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1130,"y":380,"wires":[]},{"id":"c55d32a2.85a79","type":"ui_group","name":"Orginal","tab":"6f5ce300.48f7bc","order":9,"disp":true,"width":"6","collapse":false},{"id":"8af25296.497b5","type":"ui_group","name":"Bina 1","tab":"6f5ce300.48f7bc","order":1,"disp":true,"width":"6","collapse":false},{"id":"6f5ce300.48f7bc","type":"ui_tab","name":"Building Gates","icon":"dashboard","order":1}]