It looks like you have your year and week_of_month columns defined as numeric(17,17), which means 17 digits, 17 of which are behind the decimal point. So the value has to be between 0 and 1. You probably meant numeric(17,0), or perhaps you should use an integer type.