@Steve-Mcl So many thanks, your function followed by switch node discrete by msg.topic does the trick quite nicely. Could have not done this without you
Flow below in the event that anyone else may be able to benefit:
[{"id":"a5e06468.8b1ec8","type":"ui_form","z":"70fc13ea.5d03dc","name":"Input Date Range for History","label":" ","group":"b5ec3e8f.47604","order":15,"width":0,"height":0,"options":[{"label":"Start Date","value":"startDate","type":"date","required":true,"rows":null},{"label":"End Date","value":"endDate","type":"date","required":true,"rows":null}],"formValue":{"startDate":"","endDate":""},"payload":"","submit":"submit","cancel":"cancel","topic":"","x":390,"y":110,"wires":[["82f9af3b.17ab2"]]},{"id":"82f9af3b.17ab2","type":"function","z":"70fc13ea.5d03dc","name":"Select min/max","func":"let startDateTime = msg.payload.startDate.slice(0, 10) + \" \" + msg.payload.startTime\nlet endDateTime = msg.payload.endDate.slice(0, 10) + \" \" + msg.payload.endTime\n\n//msg.topic = `SELECT MAX(Altitude), MIN(Altitude) , MAX(Temp), MIN(Temp) FROM exterior_climate WHERE Timestamp BETWEEN '${startDateTime}' AND '${endDateTime}'`\nmsg.topic = `SELECT MAX(Altitude) AS MaxA, MIN(Altitude) AS MinA, MAX(Temp) AS MaxT, MIN(Temp) AS MinT FROM exterior_climate WHERE Timestamp BETWEEN '${startDateTime}' AND '${endDateTime}'`\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":385,"y":280,"wires":[["8fc8ff52.12865"]]},{"id":"8fc8ff52.12865","type":"mysql","z":"70fc13ea.5d03dc","mydb":"9b6527f7.cad8b8","name":"MYSQL","x":585,"y":280,"wires":[["7f12c8e4.c82998"]]},{"id":"7f12c8e4.c82998","type":"function","z":"70fc13ea.5d03dc","name":"Split into Topics","func":"for (let i = 0; i < msg.payload.length; i++) {\n const el = msg.payload[i];\n const entries = Object.entries(el).map(([key, value]) => ({ topic: key, payload: value }));\n node.send([entries]);\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":795,"y":280,"wires":[["b0671e81.ca3b6"]]},{"id":"b0671e81.ca3b6","type":"switch","z":"70fc13ea.5d03dc","name":"Split outputs","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"MaxA","vt":"str"},{"t":"eq","v":"MinA","vt":"str"},{"t":"eq","v":"MaxT","vt":"str"},{"t":"eq","v":"MinT","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":985,"y":290,"wires":[["182561af.897b4e"],["a3a0c418.223d68"],["1c62cb50.b20365"],["9297ba5b.193e08"]],"outputLabels":["MAX Altitude","MIN Altitude","MAx Temp","MIN Temp"]},{"id":"182561af.897b4e","type":"ui_text","z":"70fc13ea.5d03dc","group":"b5ec3e8f.47604","order":20,"width":6,"height":1,"name":"Max Altitude","label":"Max Altitude: ","format":"{{msg.payload}}","layout":"row-left","x":1305,"y":270,"wires":[]},{"id":"a3a0c418.223d68","type":"ui_text","z":"70fc13ea.5d03dc","group":"b5ec3e8f.47604","order":22,"width":6,"height":1,"name":"Min Altitude","label":"Min Altitude: ","format":"{{msg.payload}}","layout":"row-left","x":1305,"y":305,"wires":[]},{"id":"1c62cb50.b20365","type":"ui_text","z":"70fc13ea.5d03dc","group":"b5ec3e8f.47604","order":21,"width":6,"height":1,"name":"Max Temp","label":"Max Temp: ","format":"{{msg.payload}}","layout":"row-left","x":1305,"y":341,"wires":[]},{"id":"9297ba5b.193e08","type":"ui_text","z":"70fc13ea.5d03dc","group":"b5ec3e8f.47604","order":23,"width":6,"height":1,"name":"Min Temp","label":"Min Temp: ","format":"{{msg.payload}}","layout":"row-left","x":1295,"y":377,"wires":[]},{"id":"b5ec3e8f.47604","type":"ui_group","name":"Climate - Exterior","tab":"c2eeb8ac.68fa38","order":1,"disp":true,"width":"24","collapse":false},{"id":"9b6527f7.cad8b8","type":"MySQLdatabase","name":"","host":"localhost","port":"3306","db":"mqtt_data","tz":"","charset":"UTF8"},{"id":"c2eeb8ac.68fa38","type":"ui_tab","name":"Climate - Exterior","icon":"wb_sunny","order":2,"disabled":false,"hidden":false,"info":"help"}]