0

I would like to determine the number of days that an account has been open. Ideally, I would like to compare the return value to an integer(days). i.e

I would like to see if age(open_date) > 14

If anyone has any better ideas...

Thanks

1 Answer 1

1

Here is how you get the number of days comparing two dates:

SQL> select extract(day from now()-'2015-02-21'::timestamptz); date_part ----------- 122 (1 row) 
Sign up to request clarification or add additional context in comments.

2 Comments

This worked really well :) "extract(day from current_date-open_date::timestamptz)= 14" I wanted to ask what the 'tz' at the end of timestamp meant?
timestamp with TIME ZONE

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.