Subject Re: [firebird-support] Days since timestamp
Author Helen Borrie
At 10:49 AM 26/05/2006, you wrote:
>I'm pulling out my hair here...(what's left, anyway...)
>
>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!

Erk!

select
cast('now' as timestamp) - dtm_stamp as days_since_then
from tbl_event

./heLen