Stephen,

> Can you itterate a list on your own for the ID?

Unfortunately the ids are not simple sequential numbers.

> Just as a heads up using an ID col for secondary meaning is usually WRONG.
> LEFT(Id,1)=lcIdCheck)

Yep, totally agree but legacy data which I am unable to Change.

Cheers,
        Nick



> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
> Of Stephen Russell
> Sent: 07 April 2008 14:17
> To: ProFox Email List
> Subject: Re: SQL UNION for finding next/prev records
> 
> 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
> ---
> 
[excessive quoting removed by server]

_______________________________________________
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.

Reply via email to