Forgot to uncomment type casting in sql query