Zips, Longs, Lats and more headaches...

Results 1 to 2 of 2

Thread: Zips, Longs, Lats and more headaches...

  1. #1
    Join Date
    Dec 1969

    Default Zips, Longs, Lats and more headaches...

    I am trying to developed a system that finds all the other zips with in 50 miles from a zip code. I have all code in place but I am getting some errors I searched and didn&#039;t find anything helpful one.<BR>I am using the code from : <BR>the client purchased a Access 97 file that had a about 60,000 zip code in it with lats and longs, which I then imported into my SQL server. (Note the zip code, long and lat fields are all nvarchar - I think this has something to do with my problem)<BR><BR>Ok so get my Zip, I tell the sub it finds out the lat and long of the originalZip and then I use the supplied code from block 1 of code on then I use the code from block 2 (minus the brackets and my real field names..etc)<BR>so now I have a SQL statement that looks like this<BR><BR>"SELECT strZipCode FROM tblZipCodeAll WHERE sngLatitude &#060;= 30.508 AND sngLatitude &#062;= 30.218 AND sngLongitude &#062;= 90.924 AND sngLongitude &#060;= 91.259 ORDER BY strZipCode"<BR> Then the error "&#039;80040e57&#039; <BR>, Arithmetic overflow error converting numeric to data type numeric. "<BR><BR>This happens on the line that It tries to EXE the above sql string.. Any Ideas?<BR><BR>Heres what I tried:<BR>1. adding the brackets that are in the example, didn&#039;t really think that was going to work, but I&#039;m desperate.<BR>2. the Lat and long numbers use to be much longer so I cut them off at 6 char using left(string,6 )<BR>3. changing the type of the data in my sql db, I changed Zipcocdes to int, and tried several (numeric, int, decimal) for long and lat, but every time I changed it I lost all digits past the decimal (yes even with decimal data type)<BR>Please help.

  2. #2
    Join Date
    Dec 1969

    Default Try a float field type (eop)


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts