Subject RE: [firebird-support] Re: Comparing Time portion of Date in query
Author Brenden Walker
> -----Original Message-----
> From: firebird-support@yahoogroups.com
> [mailto:firebird-support@yahoogroups.com] On Behalf Of Ivan Prenosil
> Sent: Wednesday, December 21, 2005 3:36 PM
> To: firebird-support@yahoogroups.com
> Subject: Re: [firebird-support] Re: Comparing Time portion of
> Date in query
>
> >> > Does anyone know how to compare only the Time portion of a Date
> >> > field? If just run query "Select * from MyTable where Time1 <
> > Time2"

A bit more complicated, and I'm not sure exactly how efficient...but...

Where
((Extract(hour from time1) * 60 * 60) + (Extract(minute from time1) *
60) + (Extract(second from time1)))
<
((Extract(hour from time2) * 60 * 60) + (Extract(minute from time2) *
60) + (Extract(second from time2)))