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!

12 months AGO date

636380Aug 20 2009 — edited Aug 20 2009
i have a ccan_dt(connection cancellation date) for every agent

i am trying to calculate the amount the agents spend before 12 months of connection cancellation date ie ccan_dt


agent ccandt
a 14/8/2009
b 12/7/2003
c 08/10/2000
d 7/8/1999


select sum(spend),agent from spendmas where spenddt between d1 and d2 group by agent

in the above d2 is the ccan_dt of each agent and d1 is 12 before date of d2

can any one suggest the efficinet way of acheving this.

i did this by creating a temp table to hold the dates and then calculated the spend.

but how can i achevie this with out creating a temp table.

is there any regular expression which can get 12 months ago date as in OBIEE.

please advice..
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 17 2009
Added on Aug 20 2009
4 comments
3,029 views