Subject | Re: Comparing Time portion of Date in query |
---|---|
Author | surf_n_golf |
Post date | 2005-12-21T20:19:05Z |
--- In firebird-support@yahoogroups.com, "Martijn Tonies"
<m.tonies@u...> wrote:
"Client SQL dialect 1 does not support reference to TIME datatype".
<m.tonies@u...> wrote:
>Time2"
>
>
> > Does anyone know how to compare only the Time portion of a Date
> > field? If just run query "Select * from MyTable where Time1 <
> > then will rely on both Date and Time (so if Time1 has date of2003
> > 1/1/2003 and Time2 has date of 1/1/2005 then will think Time1 is
> > less than Time2, regardless of the Time portion of date).
> >
> > Only way I could think of to do this was to convert the time to a
> > string and then compare. Tried the following but both failed:
> >
> > 1) Cast to a char - but dont know how to get just Time part.
> > The "Cast(Time1, char(20))" will give me something like "01-JAN-
> > 14:04:06". This would work if could just get last 8 chars. Itried
> > to use SubStr, but interbase did not recognize this keyword.MS SQL
>
> What's wrogn with:
>
> WHERE cast(Time1 as TIME) < cast(Time2 as TIME)
>
> ?
>
> Martijn Tonies
> Database Workbench - tool for InterBase, Firebird, MySQL, Oracle &
> ServerActually, I forgot to mention that I did try that. I get error:
> Upscene Productions
> http://www.upscene.com
> Database development questions? Check the forum!
> http://www.databasedevelopmentforum.com
>
"Client SQL dialect 1 does not support reference to TIME datatype".