Subject | Re: [firebird-support] expressing time as a numeric vale in dialect 3 |
---|---|
Author | Peter |
Post date | 2005-06-08T15:28:42Z |
Ok
Thanks Martijn
Thanks Martijn
On 8 Jun 2005 at 16:48, Martijn Tonies wrote:
> Hello Peter,
>
> > I have a trigger on an insert on a table and I'm trying to set a
time
> field in dialect 3 to
> > a calculated value. (basically spaced at 1 min intervals from
midnight to
> 7 am, then
> > back to midnight as id wraps around by using modulus)
> >
> > If I use
> >
> > new.contact_time = '00:00:01' it works
> >
> > if I use
> >
> > new.contact_time = new.id * (1.000/1440)
> >
> > it compiles but fails when inserting records as I think it wants a
string
> ?
>
> No, it wants a time.
>
> > I know time is stored as a 32 bit integer and I want to set it at this
> level with an
> > integer modulus calculation.
> > Any ideas how I can set this field by calculation ?
>
> You're not calculating a time, the result of your calculation is a
floating
> point value.
>
> Cast it to TIME.
>
> With regards,
>
> Martijn Tonies
> Database Workbench - tool for InterBase, Firebird, MySQL, Oracle
& MS SQL
> Server
> Upscene Productions
> http://www.upscene.com
>
>
>
>
+++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++
>
> Visit http://firebird.sourceforge.net and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
>
+++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++
>
>
>
>
> Yahoo! Groups Links
> * To visit your group on the web, go to:
> http://groups.yahoo.com/group/firebird-support/
>
> * To unsubscribe from this group, send an email to:
> firebird-support-unsubscribe@yahoogroups.com
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.
>
--
=================================================
Peter Chaisty FInstBE e-Mail: peter@...
-------------------------------------------------
Cyionics Ltd UK
Tel: +44(0)1495 785570
All email is scanned using Norton Antivirus
=================================================