Wat is wrong in this formula column pls help me..

wat is wrong in this formula column pls help me..
function CF_BEGIN_BALFormula return Number is
cr number;
dr number;
begin
     select begin_balance_cr,begin_balance_dr into cr,dr from gl_balances
     where gl_balances.period_name=:from_period
and gl_balances.code_combination_id= :ccid;
if ( abs(CR) > abs (DR) ) then
return nvl((CR - DR ) , 0) ;
else return nvl((DR - CR ) , 0) ;
end if;
end;

Without any error message, it's guess work, but one thing - where do you expect those bind variables will come from?
FUNCTION cf_begin_balformula
   RETURN NUMBER
IS
   cr   NUMBER;
   dr   NUMBER;
BEGIN
   SELECT begin_balance_cr, begin_balance_dr
     INTO cr, dr
     FROM gl_balances
    WHERE gl_balances.period_name = :from_period
      AND gl_balances.code_combination_id = :ccid;
   IF (ABS (cr) > ABS (dr)) THEN
      RETURN NVL ((cr - dr), 0);
   ELSE
      RETURN NVL ((dr - cr), 0);
   END IF;
END cf_begin_balformula;

Similar Messages

  • What's wrong with this formula?

    What's wrong with this formula?  Why am I getting 0?

    Mismatch in data types.
    Status, "=*Book*" is fine, as the content of the status column is text, and the condition is comparing it to a text string (with wild cards)
    But
    Event Date, "=*2011*" compares a Date and Time value in Event Date to a text string (with wild cards).
    Here's a demonstration, using COUNTIF to stand in for COUNTIFS.
    Note that the "book" counts are all correct.
    Note that the first Date count counts both occurrences of Jan 2, 2012 in column A, despite the difference in format used in displaying the dates, while the second counts neither, due to the wild card forcing it to look for a text string, not a Date and Time value.
    For your case, you'll need a COUNTIFS formula with three test-range, condition pairs:
    =COUNTIFS(Schedule :: $A,"=*book*",Schedule :: $B,">="&B2,Schedule :: B,"<="&B3)
    Regards,
    Barry

  • Wat is wrong in this decode function, it doesn get executed,please help me

    wat is wrong in this decode function, it doesn get executed,please help me
    decode(DVI.COMPANY||'.')||
                                            DECODE(DVI.COST_CENTRE||'.')||
                                            DECODE(DVI.ACCOUNT||'.')||
                                            DECODE(DVI.LOCATION||'.')||
                                            DECODE(DVI.PRODUCT||'.')||
                                            DECODE(DVI.FUTURE)company_id,

    Hi,
    I could not understand what you are trying to do with decode here.
    The standard way of using the decode is like :
    SQL>SELECT DECODE (1 , 1 ,'TRUE','FALSE') FROM DUAL;
    DECO
    TRUE
    1 row selected.
    1* SELECT DECODE (1 , 0 ,'TRUE','FALSE') FROM DUAL
    SQL>/
    DECOD
    FALSE
    1 row selected.
    Please explain what you want to do with DECODE ?
    Regards

  • Prob with formula column plz help!!!!!

    hi
    iam working on a finance report
    where there is a need for opening balance and closing balance colum, i have designed the column the out put comes but the prob is after displaying the opening balance closing balance it again displays a nil opening balance and closing balance for all the values given as input
    its liek this
    opening balance=0.00
    closing balance=0.00
    i have attached the formula which i have written pls help me wats wrong in the formula column
    for opening balance
    function CF_total_dr1Formula return Number is
    begin
    IF :cf_total_dr - :cf_total_cr > 0 THEN
    RETURN(:cf_total_dr - :cf_total_cr);
    ELSE
    RETURN( 0 );
    END IF;
    end;
    similarly for closing balance too

    cf_total_dr is again calculated using a formula.. similarly cf_total_dr
    i have specified the formula below, again this debit balance is a formula column
    function CF_total_drFormula return Number is
    v_bal NUMBER;
    BEGIN
    v_bal := debit_balance(:p_from_date);
    RETURN(v_bal);
    END;

  • I am trying to setup iCloud account and when I login I see a popup. The Maximum number of free accounts have been activated on this iPhone. Pls, help me fix it. What other accounts? Thanks

    I am trying to setup iCloud account and when I login I see a popup. The Maximum number of free accounts have been activated on this iPhone. Pls, help me fix it. What other accounts? Thanks

    Then you'll have to use another iOS device or Mac running OS X Lion or higher to create a new account for you to use on your phone.  If you don't have one, perhaps a friend would allow you to create and account on their device (note: this will use one of their three maximum accounts).  To do this, they would need to go to Settings>iCloud, tap Delete Account (which will delete the account from their device but not from iCloud), then allow you to sign back in with your ID to create the new account.  Then tap Delete Account to delete the new account from their device, and finally, sign back in with their iCloud ID to restore their iCloud account to their device.  Then you can sign in with your ID on your phone in Settings>iCloud and use the new account.

  • Hi pls help me my iphone is forest i update but  after my iphone is  devices open is not working i click but sim card installed , attempting to activate this one coming pls help me answer me

    hi pls help me my iphone is forest i update but  after my iphone is  devices open is not working i click but sim card installed , attempting to activate this one coming pls help me answer me

    Sounds like your phone was hacked to use with your carrier.  Updating it has relocked the phone to it's original carrier.  You will not get the phone working again without a SIM from the original carrier.

  • After I hv upgraded os 6 on my iPhone 4, iPhone hung up at least one per day. After u press "End" 2 times( i used to do this in the old os) or when u slide to unlock - the screen suddenly enlarge . I need to reset the phone whenever this happen. Pls help

    After I hv upgraded os 6 on my iPhone 4, iPhone hung up at least one per day. After u press "End" 2 times at fast speed ( i used to do this in the old os without problem) or when u slide to unlock - the screen suddenly enlarge . I need to reset the phone whenever this happen. Pls help

    I Have fumbled all day to this resolved, I'll run the battery down and see what happens afterwards. This is not good !

  • I have an existing ipod that I use with my mac. I am trying to connect an additional ipod to it but when I try and register, it just brings up the existing info. I don't want to lose the original info or library - just create new for this device. Pls help

    I have an existing ipod that I use with my mac. I am trying to connect an additional ipod to it but when I try and register, it just brings up the existing info. I don't want to lose the original info or library - just create new for this device. Pls help...

    We are starting from the beginning like its a new ipod starts out asking language, country,location services,choose a network,and when we get to "setup ipod touch  " there are 3 options 1..setup as new ipod, 2.restore from ipod backup 3 restore from itunes backup and when we hit setup as new ipod and click next it comes up with sign in with apple id or create a free apple id  we clicked create a free apple id....then comes up with bday,1st name last name, use your current email address, get a free icloud email address or change email address and THIS is where we have problems....if we hit change email address it means that sis's stuff goes under his name and moves all her stuff to this older ipod which the brother does not want. sorry this is so long but its the only way I knew to do it.

  • HT1349 Successfully loaded ios7 to iphone 4S from iTunes...now iphone asks me to agree to terms and privacy, then it locks up and won't accept my "agree." Goes in a loop and can't get past this screen.  Pls help.  thanks.

    successfully loaded ios7 to iphone 4s.
    now iphone asks me to agree to terms and privacy, then it locks up and won't accept my "agree."
    goes in a loop and can't get past this screen.  Pls help.  thanks.

    Have you tried resetting the device?
    Hold down the home and lock buttons until you see an Apple Logo, then release the buttons.
    If that doesn't work, you should check to see if you have a backup because you may have to restore your device.

  • TS3297 after updating my iphone 3gs to ios6 a message "we're sorry, we are unable to continue with your activation at this time." pls help!

    after updating my iphone 3gs to ios6 a message "we're sorry, we are unable to continue with your activation at this time." pls help

    I have the same problem after updating to the latest iTunes. I purchased an iPhone 4S this past summer and gave my 3GS to my 6 year-old minus the SIM card-- an instant iPod Touch. Things were fine until the latest version of iTunes 11.0. Until I updated to 11.0.1, iTunes would not even "see" the iPhone.
    How do I get past the insistence to activate the phone? Right now, it's a useless brick.

  • Whats wrong with this query.can anyone help me......

    select CASE WHEN TO_NUMBER(SUBSTR(TO_CHAR(START_TIME_TIMESTAMP,'DDMMYYYY HH24:MM:SS'),13,2))>0 AND TO_NUMBER(SUBSTR(TO_CHAR(START_TIME_TIMESTAMP,'YYYYMMDD HH24:MM:SS'),13,2)) <14
    THEN TO_DATE(CONCAT(SUBSTR(TO_CHAR(START_TIME_TIMESTAMP,'YYYYMMDD HH24:MM:SS'),13,2)||'00',SUBSTR(TO_CHAR(START_TIME_TIMESTAMP,'YYYYMMDD HH24:MI:SS'),16)||'00'),'DD-MM-YYYY HH24:MI:SS') end
    from table;
    i have written this query.whats wrong with this query..........
    the error is "literal does not match format string"
    Reegards soumen

    Why does your date_format loose, ununify and not fix ?
    And what is your exact requirement?
    >>
    CASE WHEN
    TO_NUMBER(SUBSTR(TO_CHAR(START_TIME_TIMESTAMP,'DDMMYYYY HH24:MM:SS'),13,2))>0
    AND TO_NUMBER(SUBSTR(TO_CHAR(START_TIME_TIMESTAMP,'YYYYMMDD HH24:MM:SS'),13,2)) <14
    <<
    This is
    CASE WHEN TO_CHAR(START_TIME_TIMESTAMP,'MM') between '01' and '13'
    >>
    THEN TO_DATE(CONCAT(SUBSTR(TO_CHAR(START_TIME_TIMESTAMP,'YYYYMMDD HH24:MM:SS'),13,2)
    ||'00',
    SUBSTR(TO_CHAR(START_TIME_TIMESTAMP,'YYYYMMDD HH24:MI:SS'),16)||'00'),
    'DD-MM-YYYY HH24:MI:SS')
    <<
    This is
    TO_DATE(
    TO_CHAR(START_TIME_TIMESTAMP,'MM"00"SS"00"),
    'DD-MM-YYYY HH24:MI:SS')
    Obviously, format is not matching !
    SQL> select to_char(sysdate,'MM"00"SS"00') from dual;
    TO_CHAR(
    06004900
    SQL> select to_date('06004900','DD-MM-YYYY HH24:MI:SS') from dual;
    select to_date('06004900','DD-MM-YYYY HH24:MI:SS') from dual
    ERROR at line 1:
    ORA-01861: literal does not match format string

  • Wat is wrong with this simple query ???

    I am using 10gxe.
    Below is the query which is not working
    Whenever i am executing it a pop up windows is coming up
    and asking me to enter bind variables ..wat shall i do ???
    Here is a prntscrn of the issue .
    http://potupaul.webs.com/at.html
    VARIABLE g_message VARCHAR2(30)
    BEGIN
    :g_message := 'My PL/SQL Block Works';
    END;
    PRINT g_message
    Edited by: user4501184 on May 18, 2010 12:42 AM

    sqlplus "system/sm@test"
    SQL*Plus: Release 10.2.0.2.0 - Production on Tue May 18 12:45:05 2010
    Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> VARIABLE g_message VARCHAR2(30)
    SQL> BEGIN
    2 :g_message := 'My PL/SQL Block Works';
    3 END;
    4 /
    PL/SQL procedure successfully completed.
    SQL> PRINT g_message;
    G_MESSAGE
    My PL/SQL Block Works
    SQL>

  • Please wat is wrong with this program

    I want to reverse the user input but when I run this program it only asks for the input and when i key it in and press enter nothing happens.It just freezes.
    Sorry the code is a bit long .
    import java.io.*;
    class StackX
    private int maxSize;
    private char[] stackArray;
    private int top;
    public StackX(int max)  
           maxSize=max;
           stackArray=new char[maxSize];
           top=-1;
    public void push(char j) 
         stackArray[++top]=j;
    public char pop()    
         return stackArray[top--];
    public char peek()  
         return stackArray[top];
    public boolean isEmpty()   
         return (top==-1);
    class Reverser
         private String input;  
         private String output; 
    public Reverser(String in)
         {input = in;}
             public String doRev( )    
         int stackSize=input.length( ); 
         StackX theStack = new StackX(stackSize);
         for(int j=0;j<input.length( );j++)
         char ch=input.charAt(j); 
         theStack.push(ch);
         output ="";
         while( !theStack.isEmpty() )
         char ch=theStack.pop();
         output=output+ch; 
         return output;
    class ReverseApp
         public static void main(String[]args)throws IOException
         String input, output;
         while(true)
         System.out.print("Enter a string:");
         System.out.flush();
         input=getString();
         if( input.equals(""))
          break;
         Reverser theReverser = new Reverser(input);
         output = theReverser.doRev();
         System.out.println("Reversed: " + output);
    public static String getString()throws IOException
         InputStreamReader isr = new InputStreamReader(System.in);
         BufferedReader br= new BufferedReader(isr);
         String s = br.readLine();
         return s;
    }

    One potential problem is that you're using a new reader around system.in every time. I don't know what happens when you do that. Just make it a member variable, or create it once in main and pass it to getString.
    Asid from that, put a bunch of print statements in or use a debugger to see what's happening at each step of the way. You might be getting into an infinite loop somewhere in your reverse operation.

  • What is wrong with this class? Please help

    I'm trying to sort a dynamically created JComboBox into Alphabetical order. However, the class below is the result of my coding and there is a problem. the code can sort only two(2) item in the JComboBox and no more which is wrong. I do not know where i'm going wrong in the selectionSort(JComboBox cmb) method. the getLargest(JComboBox cmb) method works perfectly because i have tried it. Can somebody please take a look at my codes and help me modify it.
    Thanks
    James
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class SortCombo extends JFrame implements ActionListener{
    JButton btnAdd, btnSort;
    JComboBox cmbItems;
    JTextField text1;
    public SortCombo(){
    super("Sorting Demo");
    this.getContentPane().setLayout(new GridLayout(4,1));
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    btnAdd = new JButton("Add Item to Combo Box");
    btnSort = new JButton("Sort Items in ComboBox");
    text1 = new JTextField(20);
    cmbItems = new JComboBox();
    btnAdd.addActionListener(this);
    btnSort.addActionListener(this);
    this.getContentPane().add(cmbItems);
    this.getContentPane().add(text1);
    this.getContentPane().add(btnAdd);
    this.getContentPane().add(btnSort);
    this.pack();
    this.show();
    public void actionPerformed(ActionEvent e){
    if(e.getSource() == btnAdd){
    String s = text1.getText();
    if (!s.equals("") && !isDuplicate(s,cmbItems))
    cmbItems.addItem(text1.getText());
    }else if(e.getSource() == btnSort){
    selectionSort(cmbItems);
    // int i = getLargest(cmbItems);
    // System.out.println(i);
    public boolean isDuplicate(String stationName, JComboBox cmb){
    int j = cmb.getItemCount();
    boolean result = false;
    for (int i = 0; i < j; i++){
    String s = (String)cmb.getItemAt(i);
    if (stationName.trim().equalsIgnoreCase(s.trim()))
    result = true;
    return result;
    public int getLargest(JComboBox cmb){
    int indexSoFar = 0;
    int size = cmb.getItemCount();
    for(int currIndex = 1; currIndex < size; currIndex++){
    String strSoFar = (String)cmb.getItemAt(indexSoFar);
    String currStr = (String)cmb.getItemAt(currIndex);
    char charSoFar = strSoFar.charAt(0); charSoFar = Character.toUpperCase(charSoFar);
    char currChar = currStr.charAt(0); currChar = Character.toUpperCase(currChar);
    if(currChar > charSoFar){
    indexSoFar = currIndex;
    return indexSoFar;
    public void selectionSort(JComboBox cmb){
    int n = cmb.getItemCount();
    for (int last = n-1; last >=1; last--){
    int largest = getLargest(cmb);
    String temp = (String)cmb.getItemAt(largest);
    String temp2 = (String)cmb.getItemAt(last);
    cmb.removeItemAt(largest);
    cmb.insertItemAt(temp2,largest);
    cmb.removeItemAt(last);
    cmb.insertItemAt(temp,last);
    public static void main(String[] args){
    new SortCombo();
    }

    I beleive what is wrong is that your getLargest method returns the largest to your selection sort.The selectionSort places the largest at the end.On the next iteration it finds the largest again. this time at the end where you put it.Now it just does the same thing over again placing the same item at the end until the loop runs out.What you are left with is only one item it the right spot(sometimes 2).I could not get it to work the way you had it here so I tried a rewrite.It seems to work ok but it won't sort two words that start with the same letter properly.You may have to insert an algorithm to fix this.I got rid of the getLargest method and did everything in the selectionSort method.I used what I think is called a bubble sort but I'm not sure.
    I hope this is what you were looking for:)
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class SortCombo extends JFrame implements ActionListener{
         JButton btnAdd, btnSort;
         JComboBox cmbItems;
         JTextField text1;
         public SortCombo(){
              super("Sorting Demo");
              getContentPane().setLayout(new GridLayout(4,1));
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              btnAdd = new JButton("Add Item to Combo Box");
              btnSort = new JButton("Sort Items in ComboBox");
              text1 = new JTextField(20);
              cmbItems = new JComboBox();
              btnAdd.addActionListener(this);
              btnSort.addActionListener(this);
              Container pane = getContentPane();
              pane.add(cmbItems);
              pane.add(text1);
              pane.add(btnAdd);
              pane.add(btnSort);
              pack();
              show();
         public void actionPerformed(ActionEvent e){
              if(e.getSource() == btnAdd){
              String s = text1.getText();
              if (!s.equals("") && !isDuplicate(s,cmbItems))
              cmbItems.addItem(text1.getText());
              }else if(e.getSource() == btnSort){
              selectionSort(cmbItems);
         public boolean isDuplicate(String stationName, JComboBox cmb){
              int j = cmb.getItemCount();
              boolean result = false;
              for (int i = 0; i < j; i++){
                   String s = (String)cmb.getItemAt(i);
                   if (stationName.trim().equalsIgnoreCase(s.trim()))
                   result = true;
              return result;
         public void selectionSort(JComboBox cmb){
              int count = cmb.getItemCount();
              for(int start = 0;start < count;start++){
                   for(int x = start;x < count-1;x++){
                        String first = (String)cmb.getItemAt(start);
                        String next = (String)cmb.getItemAt(x+1);
                        char charFirst = first.charAt(0);
                               charFirst = Character.toUpperCase(charFirst);
                        char charNext = next.charAt(0);
                        charNext = Character.toUpperCase(charNext);
                             if(charFirst > charNext){
                                  String temp  = (String)cmb.getItemAt(start);
                                  String temp2 = (String)cmb.getItemAt(x+1);
                                  cmb.removeItemAt(start);
                                  cmb.insertItemAt(temp2,start);
                                  cmb.removeItemAt(x+1);
                                  cmb.insertItemAt(temp,x+1);
         public static void main(String[] args){
              new SortCombo();
    }p.s.(I removed the "this" references from your constructor when I rewrote it because they are implied anyway)
    [email protected]

  • What's wrong with this sql query?  Help

    hi
    i am having difficulty executing this query
    ResultSet s=st.executeQuery("select * from employee where iden = ?"+id);
    here in my program st is statement obg
    iden is attribute name in table
    id i am getting at run time from user
    please help...it says wrong number of parameters
    thank you

    That's correct, get rid of the Question mark. Questions marks are used in PreparedStatements, but they are also used in pattern matching. I am assuming the iden is the table identity. Therefore, I am assuming it is numeric. If so, you can't use the question mark because pattern matching is only done with strings. If you are treating your statement as a PreparedStatement, then you have done it wrong. (See the API) Here is a code snippet from the API:PreparedStatement pstmt =     
       con.prepareStatement("UPDATE EMPLOYEES SET SALARY = ? WHERE ID = ?");
    pstmt.setBigDecimal(1, 153833.00)
    pstmt.setInt(2, 110592)It seems you are using a Statement object, so, you need to get rid of that question mark.
    tajenkins

Maybe you are looking for

  • Error while running InstallOracleProfile script

    good evening every one, i have installed odac for VS 2010,while running the InstallOracleProfile script the following error occurs can any one help me in solving this problem.im using windows os. the error as follows Connected. ------ Running 'C:\Use

  • Camera Raw issue

    I have been unable to edit my pictures in Camera Raw on Bridge. When I try to use this I get this message: " Camera Raw editing requires that a qualifying product has been launched at least once to enable this feature".  I am unclear on what this mea

  • ITunes 7.3.1.3 does not recognize iPhone

    I just installed the iTunes update 7.3.1.3 and when I attach the data cable to my iPhone, nothing happens. No Icon no iPhone menu, nothing. When I plug the cable into my nano, an icon immediately appears on the left of the screen and allows me to wor

  • How can I open a file in a seperate window. for example how can"D:\asd.doc"

    how can I open a file in a separate window. for example how can I view "D:\asd.doc" in ms words window ??

  • Instructions on beefing up Apple's firewall

    Hi all, I read today some detailed instructions on how to improve the security offered by OS X's firewall... ...the problem is I stupidly didn't save the page as a bookmark or print it out, and i can't for the life of me remember where I read it...it