On Sat, Apr 5, 2008 at 3:19 PM, Nick Causton <[EMAIL PROTECTED]> wrote:
> Anyone got an idea how to optimise this SQL, I am trying to use it to find > the next / previous records via ADO but it is way too slow at the moment. > Perhaps there may be a better way of doing this without a UNION? > ---------------------- Can you itterate a list on your own for the ID? lcID = 1-4455667 Then pull off the 4455667 and add a 1 and do that ten times. lcString = "1-4455667, 1-4455668, 1-4455669,.........." Now take that string and use that in your Where clause. SELECT * FROM Master WHERE ; Id in lcIDString Just as a heads up using an ID col for secondary meaning is usually WRONG. LEFT(Id,1)=lcIdCheck) That is why this is taking so long as a WAG. -- Stephen Russell Sr. Production Systems Programmer Mimeo.com Memphis TN 901.246-0159 --- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html --- _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

