Subject RE: [ib-support] time from timestamp
Author Thomas Steinmaurer
> Thomas Steinmaurer wrote:
> >
> > select extract (hour from mytimestamp) || ':' || extract (minute from mytimestamp) from MYTABLE2
>
> Unfortunately thats only half good - '1:5' is not a very convincing time :(

Yep ;-).

If you are using Firebird you could use the built-in SUBSTRING function.
(otherwise look for a equal function in one of the available UDF libs)

For example:
select substring((cast(mytimestamp as time)) from 1 for 5) from MYTABLE2


You could also store the time in a separate field maintained by a
BEFORE INSERT/UPDATE trigger.


HTH,
Thomas Steinmaurer
IB LogManager 2.1 - The Logging/Auditing Tool for InterBase and Firebird
http://www.iblogmanager.com