So, I'm guessing this problem is because there are days in your monthly table that do not have any data. Check to see if that is the case. If so, add this to the end of the script that establishes your rainsuninsolByMonthHour table to ensure it has at least one row for every day:
Code: Select all
INSERT IGNORE INTO rainsuninsolByMonthHour(LogDateTime)
VALUES
("yyyy-mm-dd hh:mm:00");
("2019-02-02 12:59:00");
if you have more than one day completely missing, separate each one by a comma and terminate the last one with a semicolon as in:
Code: Select all
INSERT IGNORE INTO rainsuninsolByMonthHour(LogDateTime)
VALUES
("yyyy-mm-dd hh:mm:00"),
("yyyy-mm-dd hh:mm:00"),
("yyyy-mm-dd hh:mm:00");
Let me know how you get on. If you can eliminate this error then we are one step closer to a satisfactory outcome