Subtract negative number given positive number

I am trying to subtract 2 items  rev - cost. But some cost are negative numbers and therefore and therefore causing
rev- (-cost) becoming rev+ cost causing big number answers.
0- (-cost) becoming rev+ cost 
 -rev - (-cost) becoming rev+ cost .
Any way to solve this issues.

try 0-(-14,574) = it is given me 14,574 that I s not correct.
Well, it is correct according to the math I learnt in school.
I like to remind you that this is a not a quiz forum where you ask questions to test the members. This is a forum where you ask for help, and to get help, you need to state clearly what you need help you. Only answering "not good, sir" is completely
useless.
Please state clearly what you want to achieve. For this type of problem it is often a good idea to post:
1) CREATE TABLE statements for your tables.
2) INSERT statements with sample data.
3) The desired result given the sample.
4) The business rules that explain why you want that result.
5) Which version of SQL Server you are using.
Erland Sommarskog, SQL Server MVP, [email protected]

Similar Messages

  • Emptying the Trash - Positive number to Negative number?

    Should I worry when emptying items in Trash that "Items to delete" goes from a positive number to a negative number?

    I understand your reluctance to use Terminal, and it'a healthy respect. The rm command can easily wipe the entire drive if it's entered incorrectly.
    However, if you copy and paste the lines direct from the page you should be OK.
    Whatever you choose to do, first get another external drive and clone your system to it using the Restore function in Disk Utility (after partitioning as GUID and formatting as Mac OS Extended, Journalled if necessary)
    Restart with the alt/option key held down and select the new clone to boot from.
    When you're happy it works OK, restart normally, eject the drive and remove it. This is your safety net.
    While you may be fearful of Terminal, I hesitate to suggest taking it to the Genius bar. You could end up with a re-installed system, which wouldn't be your current Tiger.

  • Dividing a positive number (499926843) by 8 gives me a negative number?????

    Hi,
    I am dividing the positive number 499926843 by 8, and this is giving me the negative number -36944069. It doesn't seem like a precision issue, since 499926843 is less than 2^32. What is going on here?
    Thanks,
    C.

    I am dividing the positive number 499926843 by 8No, you're not.
    You.re dividing (endX-startX+1)*(endY-startY+1)*bands*cellDepth by 8,
    and the intermediate product of the multiplication is 3,999,414,744 which is too large for an int.
    Either change the calculation to (endX-startX+1)*(endY-startY+1)*bands*(cellDepth/8)
    or change to longs.

  • How to find Negative number

    can any one pls tell me how to find negative number ?
    Thanks

    1. One easy method is to look for the giveaway dash in front of the number, e.g. "-1" is a negative number, given the "-" instead of the "1."
    2. Negative numbers can also sneakily be found by multiplying i by itself: i^2^ is a negative number.
    3. Negative numbers can hide in the exponent of e as complex numbers. e.g. e^i*pi^ is a negative number.
    4. If we're referring to Java here, perhaps the following could be of some use:
    final int ZERO = 0;
    public static void main(String[] args) {
    int a = 3;
    int b = -13;
    System.out.println(a + " is negative? " + lessThanZero(a));
    System.out.println(b + " is negative? " + lessThanZero(b));
    boolean lessThanZero(int n) {
    return n < 0;
    }

  • How do I thin a font in CS6? I tried a negative number in offset path and it didn't work.

    Hi!
    first time here. I posted this question in community guidelines by mistake, oops.
    Any help would be appreciated!
    I tried this with outlining the font and also without. The negative number in offset path doesn't thin, however if I do a preview and put in a positive number it does add onto the width of the font.
    Thanks,
    maryann

    I am going to share with you the secret to using type with appearance. After setting type change the fill to none(characheter level), then add a fill(type level). This way you do nto have 2 fills fighting with each other.
    Below I did not follow my advice to better explain what is happening, but I chose a different color fill. Even though I only have one fill, there is a black stroke coming from the character level.
    To salvage your existing type, double click so you select all the type with the |-Beam, your appearance palette will now say characters, and delete that fill.
    When you oultined your fonts, most likley the same thing happened, but a battle battle between the path and group level.

  • Negative number cannot be displayed in table if the column is too narrow

    Hi, All
    When a number is formatted  as a certain formatting(not locale formmatting),Negative number cannot be displayed in table if the column is narrower than the negative number, just minus is displayed.
    Can you help me? Thanks.
    Version: EHP1 for netweaver 7.0 SP3
    Best regards,
    Jiande Ding

    Hi,
    I think this has nothing to do with positive and negative numbers, By default the alignment of the text is Left, if you dont want to see '-' sign initially then you can change the alignment of the text to center or right in the display tab of properties for that column.
    As you as saying that at runtime the numbers are visible if manually adjusted. to icrease the width of that column permanently goto Layout tab of the story board and increase the size of the table and then increase the width of the column.
    the Fit Contents in the Layout should be set to "Actual Size".
    Regards,
    Rk.

  • Use array to store negative number

    Hi,
       I use "Initialize array" to set all the 500 elements to "0". Then I input numbers to  "Replace Array Subset"  and generate a new array. But all the positive numbers are correct, negative numbers just become "0". Why? How can I store the negative number in this array?
       Thank you in advance!

    Hi,
    what data type (numeric representation) are you using for the array elements? If it is integer, make sure it's not unsigned (U8, U16, ...) as this data type doesn't allow negative numbers.
    Hope this helps

  • Invoice verification (negative number)

    I have a purchase order with 2 item. One of them is a return item with a higher price than the other.
    In the Invoice verification i have the following problem: if the prices from both itmes are added the BALANCE is positive so the AMOUNT should be negative to make the balance 0,  but if i write in the amount a negative number i get an error message "Negative values not allowed".
    Any ideas?
    Regards

    hi,
    you can try this with Subsequent Debit, In MIRO transaction, you do subsequent debit.
    Hope this may help you,
    Regards,
    Srinivas

  • IOS Show negative number as zero

    Hi,
    I am creating a table in numbers for iPad and what I am trying to do is when a formula returns a negative number to get the cell to display 0 rather than the actual negative value but then display the positive numbers normally.
    Any ideas?
    Thanks

    If cell A1 has a value, then you can place this formula in cell B1:
    B1=if(A1<0, 0, A1)
    said in plain English.... if A1 is less than 0 return 0 otherwise return the value in A1.

  • PO_QTY came out with 0 and negative number

    Hi experts,
    I was loading data via 2LIS_02_SCL,2LIS_02_ITM. PO_QTY was populated by ABAP instance. But some PO_QTY number came out with zero and negative number while some of other PO_QTY number came out with the right number.
    I was working on this problem for 2 days but have no idea on it. Anybody can help me?
    Thanks a lot.
    Junbo

    dear Junbo,
    are you working with business content extractor only, i mean no enhancement to that field ? i think it can be 'program error' that po quantity is not correct, try to search oss note ? what's your r/3 PI level ? applied the oss note mentioned before working with lo-mm pur ? it's stated in mm pur extraction doc (if you have not this doc, let's know your email, will send you).
    if you are using business content extractor only without enhancement to this field, you may create oss message to get sap help. debug with rsa3 option debug marked is possible.
    hope this helps.

  • Problem to display a negative number in XML Publisher output in excel

    Hi All,
    I am facing problem in displaying a negative number in XML Publisher output in excel.
    My requirement is that I have to display a negative number in brackets when the output is taken in excel format. Eg: If the value is -123 then i have to display it as (123).
    I have put these brackets using a formula column in the RDF, but it is the default functionality of excel that whenever there is a number in brackets then it automatically displays that as a negative value.
    Can anyone please help me how I can display this negative number within brackets and not as a negative digit. Is there any special tag or is there any formula which can be used to convert this into text and written in the Help text of RTF template.
    This is very urgent. If someone knows please reply asap.
    Regards,
    Shruti

    This is very urgent. If someone knows please reply asap.We are all volunteers here, so no ones questions are more urgent then other ones.
    If its that urgent it would have helped if you had chosen the correct forum to ask your question BI Publisher

  • Change negative number for total amount in BP aging detailed report in PLD

    Dear Expert
    In BP aging detailed report, the total amount field display as
    -1,000.00
    May I know how to change the negative number format as
    (1,000.00)
    This is formula field.
    Thanks.

    Hi All,
    The settings can be changed from BeX (Query Designer or WAD).
    Please click on the Settings link in the generated report (either from Query Designer or WAD) and go the Data Provider tab.
    There is a header called Number Format and a drop down Display of +/- signs:, select different options from the drop down.
    Thanks and Regards,
    Arya

  • My mountain lion upgrade is take long after the initial installation finish it is showing increasing negative number like -50 munites remaining

    My mountain lion upgrade is take long after the initial installation finished it is showing increasing negative number like -50 munites remaining while still saying installing os x on the disk.
    I mean it starting saying time remaining about 6 munites
    Now it up to time remaing about -55 munites
    I thing something is wrong with this installation and all I did is fallow the onscreen instruction
    Thank

    You might want to just manually power down your machine and, if necessary, start the installation process anew. You're unlikely to damage anything by doing this. It may have actually installed and is just hanging when it's supposed to reboot.
    Good luck,
    Clinton

  • Thread Running negative number of time.

    Hi All,
    I wrote a program to check the effects of Thread priority, however to my surprise the output is weired the higher priority thread shows that it run negative number of time, below is the code.
    package javaProg.completeReferance;
    class Clicker implements Runnable
         Thread t;
         int click;
         volatile boolean  running = true;
         public Clicker(int pro)
              t=new Thread(this);
              click = 0;
              t.setPriority(pro);
         public void run()
              while (running)
                   click++;
         public void start()
              t.start();
         public void stop()
              running=false;
    public class TestClicker
         public static void main(String [] args)
              Clicker thread1 = new Clicker(Thread.NORM_PRIORITY+2);
              Clicker thread2= new Clicker(Thread.NORM_PRIORITY-2);
              thread1.start();
              thread2.start();
              System.out.println("Processing");
              try
                   Thread.sleep(10000);
              catch (InterruptedException i)
                   System.out.println(i);
              thread1.stop();
              thread2.stop();
              try
                   thread1.t.join();
                   thread2.t.join();
              catch (InterruptedException i)
                   System.out.println(i);
              System.out.println("The number of Time Thread1 executed is "+thread1.click);
              System.out.println("The number of time Thread2 executed is "+thread2.click);
    }Here is the Output..
    C:\Users\pravin>java javaProg.completeReferance.TestClicker
    Processing
    The number of Time Thread1 executed is -386946835
    The number of time Thread2 executed is 837375311Thanks!!

    Thanks a lot , I changed int click to long and its
    working fine.I am wondering why the Java Platform
    didnt throw an error or exception for overflow.Because the Java specification calls for it not to do that but instead to do what you saw and rollover.

  • In MyVerizon, my current bill ballance is a negative number. What does that mean?

    It's a negative number, and it's red, instead of black like it usually is.  It also says my bill was paid in full on the 27th of December (autopay), but there was nothing on my bank account reflecting that.  What's up with that?

    If your balance due is in the negatives that means that you have a credit balance (i.e. VZW owes you money), that will normally be deducted from your next bill. As for your bank not reflecting the payment yet, it can take a few days for VZW to actually pull if from your account, but they post payments on their side immediatley.

Maybe you are looking for