Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

90days or 3months data from the date today

788917Feb 11 2011 — edited Feb 11 2011
Hi,

I have problem on this query, I need to extract the customers that is on 90days or 3months in their subscription of the product from the date today. I know that the startdate field must be used on the condition but don't know the right formula. I have tried different condition but I'm not getting the exact data. I have tried this AND sysdate-startdate<=90 but this give me also customers with less 90 days into their subscription but I just need customers with exact 90days. While this one startdate=sysdate-90 doesn't give me results but there should be.

SELECT
c.id,
i.firstname||i.name as Name,
to_char(c.startdate,'MM/DD/YYYY') as start_date,
to_char(c.enddate,'MM/DD/YYYY') as expire_date,
to_char(c.canceldate,'MM/DD/YYYY') as cancellation_date


FROM customer c,
info i
WHERE i.id = s.id
AND sysdate-startdate<=90
AND c.enddate>=sysdate
AND c.cancellation_date >= sysdate


Thank you.
This post has been answered by 533433 on Feb 11 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 11 2011
Added on Feb 11 2011
10 comments
4,852 views