I have latitude and longitude defined as decimal(9, 6) in my zip code table, per the zip code database company's instructions.
I take a lat/lon feed it to a function in my c# program and it gives me lat/lon in boundaries for getting a list of lat/lon from the database (radius distance)
The sql code does not work with the longitude.
SELECT TOP(10) * FROM USZipCode WHERE (Latitude BETWEEN 34.7600283409472 AND 37.6513716590528) AND (Longitude BETWEEN -76.383333 AND -76.818238)
But if I skip the longitude then it works, or at least returns records even if they are the wrong ones.
SELECT TOP(10) * FROM USZipCode WHERE (Latitude BETWEEN 34.7600283409472 AND 37.6513716590528)
The only thing I can think of; is that since the longitude is negative that the sql ain't working?
This is SQL SERVER 2008 R2 and I've also tried the Lat > x and Lat > y etc.