Subject | Re: [firebird-support] Days since timestamp |
---|---|
Author | Helen Borrie |
Post date | 2006-05-26T01:03:37Z |
At 10:49 AM 26/05/2006, you wrote:
select
cast('now' as timestamp) - dtm_stamp as days_since_then
from tbl_event
./heLen
>I'm pulling out my hair here...(what's left, anyway...)Erk!
>
>Table:
>CREATE TABLE tbl_event (
> int_event INTEGER NOT NULL,
> dtm_stamp TIMESTAMP,
> PRIMARY KEY(int_event)
>);
>
>How do I work out how many days(relative to 'now') it's been since an event
>happened?
>I've got 7 levels of parenthesis and casts/extracts, and I'm getting
>grumpy!!!
>
>There's got to be an easier way!
select
cast('now' as timestamp) - dtm_stamp as days_since_then
from tbl_event
./heLen