90days or 3months data from the date today
788917Feb 11 2011 — edited Feb 11 2011Hi,
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.