Here is a no-code approach: an inject node to trigger a flow at 23:58 and a flow variable to retain the maximum value seen that day. For simplicity I have assumed the database automatically adds the timestamp to new records.
[{"id":"edbf92277c2a065b","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"6d2270bd9198cbcb","type":"group","z":"edbf92277c2a065b","name":"Insert into db (MySQL example)","style":{"stroke":"#0070c0","fill":"#bfdbef","fill-opacity":"0.52","label":true},"nodes":["56e196f68da11b69","f71943cb189f095f","7629c42c586946f3"],"x":14,"y":279,"w":672,"h":82},{"id":"25923af295679204","type":"group","z":"edbf92277c2a065b","name":"As readings arrive maintain largest as flow.maxreading","style":{"stroke":"#0070c0","fill":"#bfdbef","fill-opacity":"0.45","label":true},"nodes":["95db38b08620ab31","d13a9934bb100b40","5329268a7b012215","0b6dda8705195704","9c129465334fb50f","af232ceb1dbb0cdd","46ffef4c607e9ec1","d37bde21db120bd4","1958b0d9b0be4ba0"],"x":14,"y":19,"w":972,"h":242},{"id":"56e196f68da11b69","type":"inject","z":"edbf92277c2a065b","g":"6d2270bd9198cbcb","name":"At 23:58","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"58 23 * * *","once":false,"onceDelay":0.1,"topic":"msg.topic = \"INSERT INTO test (maxreading) VALUES(?)\";","payload":"maxreading","payloadType":"flow","x":120,"y":320,"wires":[["f71943cb189f095f"]]},{"id":"f71943cb189f095f","type":"mysql","z":"edbf92277c2a065b","g":"6d2270bd9198cbcb","mydb":"2381cb15.b563bc","name":"MySQL db","x":290,"y":320,"wires":[["7629c42c586946f3"]]},{"id":"95db38b08620ab31","type":"switch","z":"edbf92277c2a065b","g":"25923af295679204","name":"Is flow.maxreading null?","property":"maxreading","propertyType":"flow","rules":[{"t":"null"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":330,"y":120,"wires":[["46ffef4c607e9ec1"],["d37bde21db120bd4"]]},{"id":"7629c42c586946f3","type":"change","z":"edbf92277c2a065b","g":"6d2270bd9198cbcb","name":"","rules":[{"t":"delete","p":"maxreading","pt":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":320,"wires":[[]]},{"id":"d13a9934bb100b40","type":"inject","z":"edbf92277c2a065b","g":"25923af295679204","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"20","payloadType":"num","x":110,"y":60,"wires":[["95db38b08620ab31"]]},{"id":"5329268a7b012215","type":"inject","z":"edbf92277c2a065b","g":"25923af295679204","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"17","payloadType":"num","x":110,"y":100,"wires":[["95db38b08620ab31"]]},{"id":"0b6dda8705195704","type":"inject","z":"edbf92277c2a065b","g":"25923af295679204","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"24","payloadType":"num","x":110,"y":140,"wires":[["95db38b08620ab31"]]},{"id":"9c129465334fb50f","type":"inject","z":"edbf92277c2a065b","g":"25923af295679204","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"22","payloadType":"num","x":110,"y":180,"wires":[["95db38b08620ab31"]]},{"id":"af232ceb1dbb0cdd","type":"link in","z":"edbf92277c2a065b","g":"25923af295679204","name":"New Readings Arrive Here","links":[],"x":150,"y":220,"wires":[["95db38b08620ab31"]],"l":true},{"id":"46ffef4c607e9ec1","type":"change","z":"edbf92277c2a065b","g":"25923af295679204","name":"","rules":[{"t":"set","p":"maxreading","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":100,"wires":[[]]},{"id":"d37bde21db120bd4","type":"switch","z":"edbf92277c2a065b","g":"25923af295679204","name":"msg.payload > flow.maxreading?","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"maxreading","vt":"flow"}],"checkall":"true","repair":false,"outputs":1,"x":600,"y":160,"wires":[["46ffef4c607e9ec1"]]},{"id":"1958b0d9b0be4ba0","type":"comment","z":"edbf92277c2a065b","g":"25923af295679204","name":"Must allow for if flow.maxreading is not set","info":"","x":380,"y":80,"wires":[]},{"id":"2381cb15.b563bc","type":"MySQLdatabase","name":"","host":"127.0.0.1","port":"3306","db":"espresso","tz":"","charset":"UTF8"}]
I agree with @Colin though, if you store all the data you are ready when the client (you?) demands the daily average, the number of instances in the day above average, the maximum noted during daylight hours, ...