Can someone help me using a stored procedure or function to passing my stored varchar
lat;lng in table to individuals fields as float as Lat and Lng to use in radius search.
lanlng in Table
33.0000;15.222222
Thanks
Can someone help me using a stored procedure or function to passing my stored varchar
lat;lng in table to individuals fields as float as Lat and Lng to use in radius search.
lanlng in Table
33.0000;15.222222
Thanks
SQL Server Zipcode Latitude/Longitude proximity distance search might be of help to you, look at the functions on that page
Are you just trying to split the string? If so:
declare @LatLng varchar(100)
set @LatLng = '33.0000;15.222222'
declare @Lat float
declare @Lng float
select @Lat = CAST(LEFT(@LatLng, charindex(';',@LatLng)-1) as float)
select @Lng = CAST(SUBSTRING(@LatLng, charindex(';',@LatLng)+1, LEN(@LatLng)-charindex(';',@LatLng)) as float)
select @Lat as Latitude, @Lng as Longitude