Thanks for the help. Having thought it through I worked it out using the following - thought I would post it just in case someone else has the same issue.select state, zipcodefrom locationwhere country = 'US' and postalcode not between '0' and '99999' and postalcode <> ''group by postalcode, statecodeorder by postalcode desc
This created a list of bad zipcodes in a state. Then I cleaned usingupdate locationset zipcode = '99999'from locationwhere country = 'US' and zipcode not between '0' and '99999' and zipcode <> ''
99999 is set as default for this task.