Advertisement

06.12.2008 at 07:35AM PDT, ID: 23479613
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.0

sql

Asked by Sara_j_11 in Oracle Database, Oracle 9.x, PL / SQL

I have a table
Acct_nbr, Join_date, Close_date
12,            30-Jun-2007     30-Jan-2008


MY QUESTION : I WANT TO CHECK IF THE ACCOUNT HAS CLOSED HIS ACCOUNT BEFORE COMPLETING 1 FISCAL YEAR. IN THE ABOVE SAMPLE DATA THE ACCOUNT 12 CLOSED HIS ACCOUNT BEFORE COMPLETING ONE FISCAL YEAR. HOW DO I THIS. IDEALLY I WANT THE CHECK TO BE AN IF CONDITION THAT I CAN USE IN MY PLSQL CODE.  I ALSO WANT TO HAVE IF CONDITION TO FIND ACCOUNTS THAT HAVE CLOSED THEIR ACCOUNTS AFTER COMPLETING ONE FISCAL YEAR
 for example:
if (account closed his account before one fiscal year)
then &. (dont worrry about this )
end if
if (account did not close his account before one fiscal year)
then &.
end if

Example of fiscal year Fiscal year starts in  01-Jun-2007 and ends in 31/may/2008.
(Fiscal year starts in June and ends in  May always).
The funsction that I wrote to calculate fiscal year is as follows:
CREATE OR REPLACE function fs_yr(alian_dt date) return date is
ayr number(4);
adate date;
begin
--take year component of alian_dt;
--SELECT TO_CHAR(to_DATE('alian_dt', 'MM/DD/YYYY'),'YYYY') into ayr FROM DUAL;
if ( alian_dt is null )
then
   return to_date('31-DEC-5000');
END IF;
select to_char(alian_dt,'yyyy') into ayr from dual;
select to_date('01-jun-'||ayr) into adate from dual;
if ( alian_dt >= adate )
then
   return to_date('01-jun-'||ayr,'dd-mon-yyyy');
else
   return to_date('01-jun-'||(ayr-1),'dd-mon-yyyy');
end if;
end fs_yr;
/
Start Free Trial
[+][-]06.12.2008 at 08:20AM PDT, ID: 21770458

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.04.2008 at 03:46AM PDT, ID: 22385812

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Oracle Database, Oracle 9.x, PL / SQL
Sign Up Now!
Solution Provided By: prast1007
Participating Experts: 2
Solution Grade: A
 
 
[+][-]09.27.2008 at 02:08PM PDT, ID: 22588669

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]10.01.2008 at 03:58PM PDT, ID: 22619907

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628