Viewing 15 posts - 46 through 60 (of 79 total)
Thank you very much! matt
October 20, 2009 at 12:01 am
Ok thanks Jeff - I am going to try, and try hard, to implement multiple CTEs like you suggest.. (gulp, wish me luck!) - Matt
October 19, 2009 at 11:43 pm
Thanks Jeff! - p.s. is my sql ok? I repeat the fnDistance() function three times..
Matt
October 19, 2009 at 11:12 pm
Wow, Jeff, you are the man! I will try to implement the "narrow corridor".. so i should just calculate the Max vars and add "WHERE Lat2 BETWEEN @MaxNorthLat...
October 19, 2009 at 10:45 pm
Wow! I wouldn't have guessed that the formula in the query would be faster!
October 19, 2009 at 8:37 pm
Michael - This topic utilized the same code, but was about a 'clustered index scan' ... i suppose I should have categorized it with the first post.. sorry! -...
October 19, 2009 at 8:23 pm
thank you very much - will try your code..
my clustered index is on (zip, long, lat) .. yes, changing to WHERE clause to t2 results in a...
October 19, 2009 at 7:31 pm
but Lowell - i've read that an index scan == table scan!
Matt,
NYC
October 19, 2009 at 7:25 pm
Yes, Zip code is in an index..
fnGetDistance (latitude1, long1, lat2, long2):
===============
SELECT @Distance = 3963.0 * ACOS(SIN(RADIANS(@Lat1)) * SIN(RADIANS(@Lat2)) + COS(RADIANS(@Lat1)) * COS(RADIANS(@Lat2)) * COS(RADIANS(@Long2 - @Long1)))
October 19, 2009 at 5:43 pm
thank you.. But.. for my original post and question - how can I use a UDF to simplify? tx!
October 19, 2009 at 10:57 am
Michael Valentine Jones (10/19/2009)
Dave Ballantyne (10/19/2009)
October 19, 2009 at 10:30 am
Dave Ballantyne (10/19/2009)
However , what will hurt your performance more is unnecessary calculations.
In my Sarg i...
October 19, 2009 at 9:47 am
Now I understand!!! Thanks a lot J-F!!!
Matt, NYC
October 16, 2009 at 2:19 pm
Thank you - that helps. For some reason the CASE statement below, for sorting, is not resulting in the specified sort order.. any ideas? tx Matt
SELECT * FROM
(
SELECT...
October 16, 2009 at 1:57 pm
Viewing 15 posts - 46 through 60 (of 79 total)