Re:Is there an HOUR function?
Posted in 1995
Dean Peddle has written:
> I would like to be able to have an HOUR function that works on DATETIME
> variables inthe same way that MONTH/DAY/YEAR does. For example:
>
> SELECT * FROM mytable WHERE HOUR(mydate) = 10 >
> Any suggestions on something that will provide similar capability? I'm
> not looking for a programming solution - must be able to be done
> relatively simply as an interactive SQL query
Well, Dean there is a function called EXTEND which you can use in isql
selecting or comparing any datetime column. Read the reference manual for
details. The solution for your problem is listed here :
select *
from mytable
where extend(mydate, hour to hour) = extend("10", hour to hour)
Hope this helps.
Girish
-------------------------------------------------------------------------
Standard disclaimers apply.