What’s the best way to capture the max month in a teradata query?