Subject Re: [firebird-support] SQL conundrum
Author Ivan Prenosil
> and cast (p.PCHIN as date) between '2005/4/5' and '2005/4/7'

You may also want to use index if some suitable exists on PCHIN field :

and p.PCHIN >= '2005/4/5' and p.PCHIN < date '2005/4/7' + 1;

Ivan
http://www.volny.cz/iprenosil/interbase/