Am doing query to create zip code dataset using values in the db. I am coming up with two values that are negative, and I want a list with only valid values. Here's my query:
HAR_CONSUMERS.RES_ZIP = N'73301'
OR HAR_CONSUMERS.RES_ZIP >= N'75001'
AND HAR_CONSUMERS.RES_ZIP <= N'75501'
OR HAR_CONSUMERS.RES_ZIP >= N'75503'
AND HAR_CONSUMERS.RES_ZIP <= N'79999'
OR HAR_CONSUMERS.RES_ZIP >= N'88510'
AND HAR_CONSUMERS.RES_ZIP <= N'88589'
Please help me figure out how to modify the query to NOT get the two negative numbers that are coming up. I assume these values are numbers, but perhaps that's a naive assumption.
Either way, I'd like to strip these two invalid values out. Thanks in advance!