Subject | Re: Decrement Date by 1 hour |
---|---|
Author | Adam |
Post date | 2006-06-02T04:48:03Z |
--- In firebird-support@yahoogroups.com, "Adam" <s3057043@...> wrote:
standard. So try this.
select current_timestamp - (1.0/24.0)
from RDB$DATABASE;
Adam
>current_timestamp
> --- In firebird-support@yahoogroups.com, "Dion" <27824912424@>
> wrote:
> >
> > Hi,
> >
> >
> >
> > How do I decrement the system date by an hour ie
> 1 hour.But watch the integer division gotcha. 1/24 = 0 according to SQL
> >
>
> Timestamp math. Each unit is worth 1 day. To add a day to a
> timestamp, add 1 to it, to add 5 minutes, add 5/1440, to subtract 1
> hour, subtract 1/24
>
> eg:
>
> select current_timestamp - 1/24
> from RDB$DATABASE;
>
> Pretty simple really.
>
>
> Adam
>
standard. So try this.
select current_timestamp - (1.0/24.0)
from RDB$DATABASE;
Adam