Positive numbers only

Hi All,
I am having funny problem in sql statement. I am trying to retrieve positive numbers using sql statement. I have used ABS clause but i am getting minus numbers also as positive numbers. please help me
Here is my query,
SELECT a FROM b;
O/P
-1
1
SELECT ABS(a) from b;
o/p
1
1
but i need only positive result please give me example query
Thanks,
R

Hi,
I did not what you are tring to achieve try with ">0"
- Pavan Kumar N

Similar Messages

  • Need help verifying positive numbers

    I have a payroll program I've been working on for class the last few weeks. The most recent modification is that I need to confirm the hours and pay scale are entered in positive numbers. I've tried a while and an if...else statement and am getting an error telling me that I have an "illegal start" to the expression, and that the way I've written the statement is incompatible with boolean. Here is the code - I've colored the if...else statements red. The else statements don't give me an error, but the if statements do. (BTW, I've had the same problem trying to use a while statement.)
    I'm pretty sure it has something to do with how I've written the if statement, but I can't put my finger on it. Can someone help?
    Thanks,
    import java.util.Scanner; // program uses Scanner
    public class WeeklyPayrollTest
          public static void main(String args[])
            // create scanner to obtain input from command window
            Scanner input = new Scanner( System.in );
            // declare variables
            String exitPayroll;
            exitPayroll = "N";
            double numberHours = 0;
            double payRate = 0;
            // create a WeeklyPayroll object and assign it to currentPayroll
            WeeklyPayroll currentPayroll = new WeeklyPayroll();
            PayScale thisPay = new PayScale();
            while( exitPayroll.equalsIgnoreCase( "N" ) ) // begin while loop
                  // prompt for and input employee name
                  System.out.println( "Please enter employee name: " );
                  String nameOfEmployee = input.next(); // read user input
                  // prompt for and input hours worked
                  System.out.println( "Enter hours worked: ");
    {color:#ff0000}              if( input.nextDouble( <= 0 ) ) // compare input for positive numbers
                      System.out.println( "Only positive numbers are allowed. " +
                              "Please enter a correct number." ); // alert user positive numbers needed
                  numberHours = input.nextDouble(); // prompt for hours
                  else{
                  // prompt for and input hourly pay amount
                  System.out.println( "Enter hourly rate: ");
                  if(input.nextDouble( <= 0)) // compare input for positive numbers
                      System.out.println( "Only positive numbers are allowed. " +
                              "Please enter a correct number.") // alert user positive numbers are needed
                  payRate = input.nextDouble(); // prompt for rate of pay
                  else{
                  // call PayScale
                  double weeklyPay = thisPay.payScale( payRate, numberHours );
                  // call currentPayroll's displayMesage method and
                  // pass nameOfEmployee as an argument
                  currentPayroll.displayMessage( nameOfEmployee, weeklyPay );
    {color}             
                  System.out.println( "Would you like to exit this program? " +
                          "Enter Y for yes and N for no." );
                  exitPayroll = input.next(); // read user input
               } // end while loop
          System.out.println( "Thank you for using this payroll program." );        
        } // end main
    } // end class WeeklyPayrollTest

    if( input.nextDouble( )  <= 0) // compare input for positive numbers
                      System.out.println( "Only positive numbers are allowed. " +
                              "Please enter a correct number." ); // alert user positive numbers needed
                      numberHours = input.nextDouble(); // prompt for hours
    }This will through away the result. Try this
    numberHours = input.nextDouble;
    while ( input.nextDouble( )  <= 0) // compare input for positive numbers
                      System.out.println( "Only positive numbers are allowed. " +
                              "Please enter a correct number." ); // alert user positive numbers needed
                      numberHours = input.nextDouble(); // prompt for hours
    }

  • How do I set a form field to accept whole numbers only?

    I am using Acrobat X.
    I have a number of fields in a form that are used in a variety of calculations. It is the nature of these fields that they need to contain whole numbers only, no decimals.
    On the "Format" tab, I have set the field format to "Number" and the number of decimal places to "0"
    On the "Validate" Tab I have set the "Field Value is in Range" "From 0", "To 999"
    This is to ensure that the field can only contain a maximum of a three digit number.
    But this still allows the user to enter decimal places. This messes up my calculations so I want to limit the user's input to whole numbers.
    How do I do that?
    Thanks!
    Steve

    I apologize for being dense but I really do not know how to apply your solution. Taking the path you suggested there is nothing under Tools>Document Processing relating to Java scripts.
    I presume that I have to save this part somewhere in Acrobat:
    // Document-level function
    function triDigKS() {
        // Get all that is currently in the field
        var val = AFMergeChange(event);
        // Reject entry if anythig but digits
        event.rc = AFExactMatch(/\d{0,3}/, val);
    And then use the call out:
    // Custom Keystroke script
    triDigKS();
    Somewhere else but I don't know where thos two places are. Do I use the callout in the validation tab, or somewhere else?
    Thanks
    Steve

  • Keep Original Position Numbers in Purchase Order Creation

    Hi community, i'm trying to solve the following problem in purchase order creation using BAPI_PO_CREATE1:
    I'm loading a file with several order numbers and positions to be created in R/3. This file has a structure similar to:
    OrderNumber;PositionNumber;Material;Quantity;Unit;.......
    The purchase order is created successfully, but i need to keep original position numbers in the order. i.e:
    Supposing this input file:
    1900;08;993322;10.00;KG.....
    1900;13;994455;12.00;KG.....
    the positions in purchase order are created as
    00010
    00020
    But i need positions to be created as:
    00008
    00013
    Any ideas?????
    Thanks you for your cooperation
    Leonardo

    Hi Leonardo,
       I doubt if that is possible.
    You can have the configuration set up to set the Item Number Interval to  step size like 5,10,15 etc,
    based on this value, your line item number will be
    5,10,15,20...
    10,20,30,40..
    15,30,45,60
    etc.
    to set this value, you should go to SPRO.
    Material Management->Purchase Order->Define Document Types
    Regards,
    Ravi Kanth Talagana

  • How to validate an text field item using javascript for numbers only.

    hi,
    how to validate an text field item using javascript for numbers only.please help me on this urgent
    please mail me solun if posible on [email protected]

    Hi,
    Page HTML header
    <script>
    function onlyNum(evt) {
      // Usage: onKeyPress="return onlyNum(event)"
      evt = (evt) ? evt : window.event;
      var charCode = (evt.which) ? evt.which : evt.keyCode;
      if (charCode > 31 && (charCode < 48 || charCode > 57)) {
        var status = 'This field accepts numbers only!';
        alert(status);
        return false;
      var status = '';
      return true;
    </script>Item HTML Form Element Attributes
    onKeyPress="return onlyNum(event)"Br,Jari

  • Forcing Key Entry to numbers only

    HI all,
    I am using a textbox with constraints in my program and was wondering how do I set the keys on the mobile phone to enter numbers only without getting the user to have to hit the key that changes input from letters to numbers.
    with regards
    James

    Duh!, that is what constraints does. I should have tested it first. smile
    cheers.

  • Limit contacts to phone numbers only

    Is there a way to limit the contacts list to phone numbers only instead of having it list people by phone and all of the email addresses that aren't associated with email addresses?

    Try adding a + in front of the country code.
    https://discussions.apple.com/message/20090746#20090746

  • Excel allows array arithmetic (e.g. sum(a1:a5* b1:b5) where the contents of the cells are the results of formulae.  Numbers only allows constants in the array cells. Right?  Any work-arounds?

    Excel allows array arithmetic (e.g. sum{(a1:a5* b1:b5)} where the contents of the cells are the results of formulae.  Numbers only allows constants in the array cells. Right?  Any work-arounds?

    CJPerry wrote:
    Any work-arounds?
    There is a very simple one : use libreOffice.
    Yvan KOENIG (VALLAURIS, France) dimanche 1 janvier 2012
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My iDisk is : http://public.me.com/koenigyvan
    Please : Search for questions similar to your own before submitting them to the community
    For iWork's applications dedicated to iOS, go to :
    https://discussions.apple.com/community/app_store/iwork_for_ios

  • How do I export/save (iOS numbers)only 1 sheet to pdf??

    How do I export/save (iOS numbers)only 1 sheet to pdf??
    Everytime i tried it ,,,every pages/sheet lays in the pdf-file..

    Trying with better english
    In Numbers 08, I used to be able to export a single page to a PDF. Now it seems as though my only option is to export the entire document to the PDF (Share > Export...). Am I missing the option or did they remove it from us?

  • Creating a numbers only textfield

    Hi everybody,
    I was wondering whether or not you lot can help me out.. I'm new to fillable forms.
    Basically I am creating a form for my clients to fill out to set up a standing order with my company.
    A problem I have run into is when I create a textfield for two sections..
    Bank Account number: I only want them to be able to type only numbers in here, first off I chose Format: Numbers, but then realised (not sure if it is common or not) that if their account number started with 0, it would not count that in the field and disappear. I then made an Arbitrary Mask, but again, I do not know how long account numbers should be, so unsure how many "9" codes to do, and if it was longer or shorter than the Arbitrary Mask code, it would not accept it.
    I want to know if theres a way to force numbers only, but to include 0 as a number if thats what the account number starts with and not limit the amount of numbers they could have in their AC number (like the Arbitary Mask does)
    I'm not very familiar with Javascript either so I can't really do the Custom textfields...
    Any help is much appreciated.
    Thanks,
    Will

    I have tried putting your script into the Validation section, but if I have Format:Numbers
    it still does not include 0 as a number
    If I input 0123456 after clicking out of the form, it turns to 123456
    With the Arbitary Mask + the script, it still forces me to input as many numbers as I inputted into the Arbitary Mask section.
    Thanks for your quick reply though

  • Error ! Specify positive values only

    Dear Gurus,
    Error : Specify positive values only
    Message no. 00126
    Is it possible to create Negative value in PO line at item level? through condition type or any other method?
    But, Over all PO at header level will be positive. I dont want to go through Return PO option
    Please advice
    Thanks
    RS

    Hi,
    Why the value to be negative. I think you cant enter negative value for a material. Kindly explain me your scenario.
    Regards,
    Prasath

  • Regex - Pattern for positive numbers

    Hi,
    I wanna check for positive numbers.
    My code so far:
    Pattern p = Pattern.compile("\\d+");
    Matcher m = p.matcher(str);
    boolean b = m.matches(); But I don't know how to check for positive numbers (including 0).
    Thanks
    Jonny

    Just to make your life easier:
    package samples;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    * @author notivago
    public class Positive {
        public static void main(String[] args) {
            String input = "- 12 +10 10 -12 15 -12,000 10,000 5,000.42";
            Pattern p = Pattern.compile( "\\b(?<!-\\s?|\\.|,)([0-9]+(?:,?[0-9]{3})*(?:\\.[0-9]*)?)" );
            Matcher matcher = p.matcher( input );
            while( matcher.find() ) {
                System.out.println( "Match: " + matcher.group(1) );
    }

  • Regex question - looking for numbers only

    I'm getting a bit stuck with a simple regular expression.
    I want to find the records that consist of numbers only. From the example below, I'm looking for just the first record, which has '1234'.
    I tried looking for digits, but not alphabetic, but that doesn't work.
    Any ideas?
    Thanks.
    drop table test_regex;
    create table test_regex as (
    select '1234' col1 from dual
    union all
    select 'abcde' col1 from dual
    union all
    select 'a1b3c3' col1 from dual
    union all
    select '123c3' col1 from dual
    union all
    select 'a_*1' col1 from dual
    union all
    select '  9  ' col1 from dual
    union all
    select '    ' col1 from dual
    select *
    from test_regex
    where REGEXP_LIKE(col1, '[[:digit:]][^[:alpha:]]')
    /

    Something like this?
    WITH t AS (SELECT '1234' col1
                 FROM DUAL
                UNION ALL
               SELECT 'abcde' col1
                 FROM DUAL
                UNION ALL
               SELECT 'a1b3c3' col1
                 FROM DUAL
                UNION ALL
               SELECT '123c3' col1
                 FROM DUAL
                UNION ALL
               SELECT 'a_*1' col1
                 FROM DUAL
                UNION ALL
               SELECT '  9  ' col1
                 FROM DUAL
                UNION ALL
               SELECT '    ' col1
                 FROM DUAL)
    SELECT t.col1
      FROM t
    WHERE REGEXP_LIKE(t.col1, '^[[:digit:]]+$')
    ;You may want to take a look at something I wrote in this forum: Introduction to regular expressions ....
    C.
    Message was edited by:
    cd

  • Have a PowerBook G4. I mistakenly hit a key (don't know what) that changed the entire keyboard into either typing numbers only or nothing at all. Please HELP...

    I have a PowerBook G4, 10.4.11. I mistakenly hit a key (don't know what) that changed the entire keyboard into either numbers only when typing or nothing at all with half the keyboard. Please HELP...

    Thank you TONS a brody.  Really appreciate it. 

  • Why does Adobe Reader XI set my keyboard to display NUMBERS ONLY when I open a .pdf file?

    I need to keep re-booting my laptop to resolve above bug. Ideas please?

    ONE MONTH AND NO REPLY - WHO  CAN ADDRESS THIS BUG????
    WHEN I OPEN A .pdf document using ADOBE READER 11.0.2  BEHAVIOR is described BELOW. I CANNOT BE MORE COGENT.
    It occurs both within Adobe Reader functions, such as page printing options, and in all APPLICATIONS (Gmail, Word, etc) once I close .pdf document.
    SOLUTION: I MUST POWER DOWN/UP EACH TIME I USE ADOBE READER. THIS IS IDIOCY.
    1. Keyboard appears RESET to display numbers ONLY, and numbers displayed to DO NOT CORRESPOND to numbers I TYPE.
    AFTER ADOBE READER IS CLOSED I type "A" into say, an email address field and a random number, say, "9" appears in the field not an "A".
    WHILE IN ADOBE READER  I type "23" into the .pdf "go to page" field, and get other numbers completely.
    Happens ONLY when I open a .pdf file with Adobe Reader 11.0.2 (XI).
    Both behaviors occur whether I open a download .pdf file or attempt to open a .pdf via search engine Google + my Browsers.
    2. Operating System = Windows 7.
    3. My Browser = Internet Explorer 9 or Mozilla Foxfire; behavior is identical on either. Search engine used is Google.
    Weird, but true, and tiresome. I've had it..
    Message was edited by: SueB17 3/19/2013
    Message was edited by: SueB17

Maybe you are looking for

  • Can't no one do it. plz help me

    Hi Friends I wrote a code in Applet for connecting Database.I did it using servlets and JSP successfully, and also the connection is created successfully when codding in main() for DOS Console, but now I try it in Applet but the ClassNotFoundExceptio

  • Equivalent to EVAL function in PHP?

    Based on what option the user selects from my select list, my APEX report of type SQL query should be rendered. This works fine for situations like: SELECT * FROM table_name WHERE field_name = :P101_item_name But here I face the problem: In case the

  • Connect Webmethods Flowservoce using RFC Dest Type G

    Hello Friends, For my scenario i need to send Material Master Idoc to Webmethods, the idoc is received by a flow service written in Webmethods developer. now I am strucked at RFC destination i am trying to create TYPE G connection, here what value i

  • Problem with Rmiregistry

    this is simple rmi program and its related execution procedure and exceptions please help me out of this situation.. i have jdk 1.4 version import java.rmi.*; public interface Inter extends Remote public String say() throws RemoteException; import ja

  • Maximum Number of Results in Incident (ZMIN)

    Hello! How is it possible to increase Maximum Number of Results in Incident (ZMIN) for all users?