Subject | Re: [firebird-support] SQL conundrum |
---|---|
Author | Ivan Prenosil |
Post date | 2005-04-08T18:57:13Z |
>> A time literal has to be of the format 'hh:nn:ss.xxxx'.You can cast TIMESTAMP to both DATE and TIME (dialect-3 only):
>
> This does exactly what I want (got the idea from your book, p. 158):
>
> select e.fullname, d.deptname, p.dayofweek, p.pchin,
> p.pchinloc, p.pchout, p.pchoutloc
> from pchup p
> join empinfo e on e.empno = p.empno
> join dept d on d.deptno = p.pchdept
> where (id > 305)
> and cast (p.PCHIN as date) between '2005/4/5' and '2005/4/7'
> and cast (extract (HOUR from p.pchin) as char(2))|| ':' ||
> cast (extract (MINUTE from p.pchin) as char(2))|| ':' ||
> cast (extract (SECOND from p.pchin) as char(7))
> between '13:00:00.0000' and '23:59:59.9999'
where (id > 305)
and cast (p.PCHIN as date) between '2005/4/5' and '2005/4/7'
and cast (p.PCHIN as time) between '13:00:00.0000' and '23:59:59.9999'
Ivan
http://www.volny.cz/iprenosil/interbase/