Fix array bound for sql intervalInMinutes

[#1306026]
Fix array bound for sql lastDayOfMonth

[#1306026]