On Tue, Mar 4, 2008 at 9:53 AM, MB Software Solutions General Account <
[EMAIL PROTECTED]> wrote:

> Peter Cushing wrote:
> > MB Software Solutions General Account wrote:
> >
> >> sele daynum, time, start ;
> >>     from i_sched ;
> >>     where empty(stop) or stop >= ldDate + (daynum-1);
> >>         and start <= ldDate + (daynum-1);
> >>     into cursor TempISched
> >>
> >>
> > You might also want to put brackets round the OR part of the where as
> > the AND takes precedence over this:
> >
> > where (empty(stop) or stop >= ldDate + (daynum-1)) and start <= ldDate +
> (daynum-1)
> >
> > or as Christof was suggesting:
> >
> > where (stop = {} or stop >= ldDate + (daynum-1)) and start <= ldDate +
> (daynum-1)
> >
> >
>
> Hi Peter,
>
> Yeah, I did that too.  I pointed that out to the other developer the
> other day when I was analyzing this.  Apparently it had been that way
> for some time....wondered about the legitimacy of those past results!!!!!
>

---------------------------------------------------------------------------

Depending on the # of rows in the table an OR could be a bad thing.

>> sele daynum, time, start ;
>>     from i_sched ;
>>     where empty(stop) or stop >= ldDate + (daynum-1);
>>         and start <= ldDate + (daynum-1);
>>     into cursor TempISched

  sele daynum, time, start ;
     from i_sched ;
     where empty(stop) ;
union all
sele daynum, time, start ;
     from i_sched ;
where stop >= ldDate + (daynum-1);
         and start <= ldDate + (daynum-1);
     into cursor TempISched


HTH


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

Reply via email to