Subject Re: [ib-support] Strange query results, based on where clause
Author Woody
From: "Ann W. Harrison" <aharrison@...>
> the 19th and the 20th. However, it doesn't explain why
> s.del_date between '2/19/2002' and '2/20/2002'
> returned values for the 20th. It should have returned values for
everything
> starting at the midnight between the 18th and 19th, up to but not
including
> things that started at the midnight between the 19th and 20th.

I believe, you mean including midnight of the 19th, assuming that the dates
are interpreted as 02/20/2002 00:00:00. When using between, records are
found which match each end limit and everything between them.

Where ID between 1 and 10

will retrieve records with an ID equal to either of those and anything
in between.

Effectively, the date parameters could be set using time codes tacked onto
the dates being requested. That would eliminate the problem if this is what
it is.

>
> Why changing something from
> s.account_id in (1)
> to
> s.account_id in (1,2)
> should have any effect I haven't a clue.

This also threw me. It made me initially start thinking that somehow the
internal query engine was treating the query differently because of multiple
entries in the set. I don't know the internals of it but I tend to be
optimistic that the engine would handle it the same way, regardless of one
or more elements.

Woody (TMW)