Subject RE: [firebird-support] Re: Decrement Date by 1 hour
Author Dion
Tried that, but has no effect

Ie
select fc.contractoid, fl.*, (cnt.todate - (2/24)), cnt.todate
from forklift fl
join forkliftcontract fc on (fc.forkliftoid = fl.oid)
join contract cnt on (cnt.oid = fc.contractoid)

where :adate >= cnt.todate and :aDate <= (cnt.todate - (1/24))

Regards,
Dion

-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Adam
Sent: 02 June 2006 06:44 AM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Re: Decrement Date by 1 hour

--- In firebird-support@yahoogroups.com, "Dion" <27824912424@...>
wrote:
>
> Hi,
>
>
>
> How do I decrement the system date by an hour ie current_timestamp –
1 hour.
>

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








++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

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







--
Internal Virus Database is out-of-date.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.7.0/346 - Release Date: 23/05/2006


--
Internal Virus Database is out-of-date.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.7.0/346 - Release Date: 23/05/2006