Number function issue

Hello all.......
dears i have a numeric column and i want to round numbers like (0.2100 till 0.2599) become 25 and (0.2600 till 0.3099) become zone of 30 and so on. as follow:
(0.2100-0.2599) become 25
(0.2600-0.3099) become 30
(0.3100-0.3599) become 35
please i need a query to do that.
appreciate your assistant.

Well, you could do some math in your query to get the results you want.
something like this (not tested for all the test cases):
SELECT A, (TRUNC((TRUNC(A*100)+4)/5))*5 rounded_a FROM testtab;
         A  ROUNDED_A
       .21         25
     .2267         25
     .2599         25
       .26         30
     .2723         30
     .3099         30
      1.81        185
    1.8599        185
This query will help you understand how the rounded_a expression is working by showing you the intermediate results:
SELECT A
      ,TRUNC(A*100) ir1
      ,TRUNC(A*100)+4 ir2
      ,(TRUNC(A*100)+4)/5 ir3
      ,TRUNC((TRUNC(A*100)+4)/5) ir4
      ,(TRUNC((TRUNC(A*100)+4)/5))*5 rounded_a
FROM testtab;BEWARE! There are a lot of hard-coded values in the query. If your 'rounding' logic changes, you will have to change your code.
Edited by: kedruwsky on Jan 26, 2011 11:34 PM

Similar Messages

  • IDoc Item Level number Generation Issue.

    Hi,
    I am in the need of the mapping information.
    Header_File1:
    1234     567890
    1234     678901
    Cont_File2:
    1234     567890     123456
    1234     567890     123457
    1234     678901     789012
    1234     678901     789013
    Cont_Item_File3:
    1234     567890     123456     9876543
    1234     567890     123456     9876544
    1234     567890     123457     9876549
    1234     567890     123457     9876550
    1234     678901     789012     9876555
    1234     678901     789012     9876555
    1234     678901     789013     9876596
    1234     678901     789013     9876597
    According to the above Cont_File2 4 Idocs will be created with the reference of the Cont_File2.
    While in the Item Level mapping (Field Name - Itemno) I want to generate the number with the increment of 5.
    Using the counter java funcation Inital Value 10, Incement by 5 then Format number function is using and it is mapped with the target field.
    Now the problem is for creating the Item level IDoc for the first IDoc it is creating with the the values 10 and 15. 2 Items are created according to the Input file.
    While creating the next IDoc the number has to start from 10. But it is taking from 15+5 = 20.
    Please let me know what funcation or UDF to fix this issue.
    Jane

    Ok. By mistake . you need to use a UDF.
    like this Type UDF = By Context
    Parameters field[]
    Parameters value = constant 10
    try this
    int inc  = Integer.parseInt(value[0]);
    for (int j = 0; j < field.length; j++){  
           result.addValue(Integer.toString(inc));
           inc = inc+5;
    field--->UDF >splitbyValue->Target
    change the context of field.

  • Function issue of Cross-Reference

    Hi,
    thanks for your attention on this topic.
    there is function issue of Cross-Reference.
    when click the Cross-Reference after re-installed the software (adobe Framemaker 7.10), the function is not working. please kindly check the screenshots below:
    Error message below:
    Please help to check this issue.
    software: Adobe Framemaker 7.10
    System: windows xp sp3
    thanks in advance for your support .
    Message was edited by: Lu Steven

    Fire the error log off to the e-mail address indicated in the error message and then contact Adobe Support.

  • Is there a ¿ is number function ? in the  link editor

    Good afternoon all,
    I would like to test if a character is a number or a string .  ¿ How can I do it ? .  I can not find any function in the link editor .
    Thanks in advance,

    If you use the number() function here are the results you will get:
    number("300") returns 300
    number("abcde") returns error
    number("301abcde100") returns 301
    number("abde300") returns error
    a better way to test for a number only vs an alphanumeric string is to use the format function like this:
    format(300,"#") returns 300
    format("300","#") returns 300
    format("abcde","#") returns error
    format("301abcde100") returns error
    format("abde300") returns error
    regards, Steve

  • A number of issues with my Xperia Z1

    I have had my Xperia Z1 since around November 2013.
    I have been having a few issues with it. After calling my service provider they suggested I do a factory reset.
    That's where my first problem comes in. I have tried a number of times to back up my phone onto my computer using Sony Companion. It runs smoothly for about 90% of the process and then at the last stretch it will go from
    '30 minutes remianing' to '8 hours remaining' and the more time passes, the longer the back up says it will take.
    With that being said, I haven't been able to successfully back up my phone so I can reset it.
    Issue #2: My phone will sometimes just say it has no service. It bounces from having 5 full bars to zero, and then drops my calls. I called my service provider, they said it's a problem with the phone.
    Issue #3: When using the stock SMS app, all my texts (no matter what device I send to) my texts are sent doubled or tripled. On my actual screen is doesn't appear this way, but people complain all my texts are doubled.
    So I started using Google Hangouts, and that isn't working well either. All the texts are out of line. I'll get texts from over a month ago pop up in my notification and it disappears. Sender/receiever texts don't align and it gets confusing when my messages are delayed, even though it says it's been sent/receieved on time.
    Issue #4: The only way to correct my SMS issues is by restarting my phone. Which I sadly do about 10 times daily.
    When using the stock SMS app, it often crashed (it is now disabled). Same thing now with Hangouts. It will crash and not let me re open unless I power off/on. 
    I am not sure if this is where I should be posting about the number of issues I am having.
    Will my backup actually take 8+ hours (and to clarify, I disable backing up pictures/videos/music to save space).
    I put my phone in Airplane mode and leave it idle and it still says it will take all day to back up.
    Any help or suggestions is greatly appreciated. 

    Have you tried starting the phone in safe mode,see if there is any app acting up messing around with your phone?A backup should not take that long,but if you do have a lot of media,it is better to copy it directly to your pc and backup only small packs of data(messages,contacts,settings etc).I suggest using myphone explorer for messages and contacts.
    To start your phone in safe mode:
    http://talk.sonymobile.com/t5/FAQ/How-to-boot-your-phone-into-safe-mode/m-p/348008#U348008
    All we have to decide is what to do with the time that is given to us - J.R.R. Tolkien

  • Problem using number function

    Hi!
    I used Publisher Desktop to design RTF template for FSG report.
    I had to make comparison between two values in XML I got from FSG and based on their values show or hide a field in the report.
    I used following commands to get values in variables:
    <?variable:prihod?><?translate( /MasterReport/fsg:RptDef/fsg:RptLine[@LinCnt='l100090']/fsg:RptCell[@ColCnt='c1004'],’,’,’’)?><?end variable?>
    <?variable:rashod?> <?translate(/MasterReport/fsg:RptDef/fsg:RptLine[@LinCnt='l100091']/fsg:RptCell[@ColCnt='c1004'],’,’,’’)?><?end variable?>
    then I used following choose to decide wether to show or not the values:
    <?choose: ?>
    <?when: @LinCnt='l100090'?><?end when?>
    <?when: @LinCnt='l100091'?><?end when?>
    <?when: @LinCnt=’l100092’?><?if: boolean(number($prihod) >= number($rashod))?><?fsg:RptCell[2]?><?end if?><?end when?>
    <?when: @LinCnt=’l100096’?><?if: boolean(number($prihod) < number($rashod))?><?fsg:RptCell[2]?><?end if?><?end when?>
    <?otherwise: ?><?fsg:RptCell[2]?><?end otherwise?>
    <?end choose?>
    It worked just as I planned but then I uploaded it to EBS.
    I generated XML from FSG.
    Then I invoked XML Report Publisher for that XML.
    But it ended with error with following message:
    Caused by: oracle.xdo.parser.v2.XPathException: Cannot convert 0.00 to number.
    The value I'm checking with number function is 0.00.
    Now I don't understand where is the problem.
    My computer is set to Croatia-Croatian, whole text in word is set to Croatian.
    I uploaded the template with Croatia-Croatian.
    When invoking XML Report Publisher I choosed Croatia-Croatian.
    And locally it works and on the server it's not.
    Any ideas?

    I also tried now one trick but it didn't help and I ended even more confused.
    Originally number is in xml in following format:
    First I removed all the comas from the number because I read that group separators tend to confuse the xslt number function.
    Now I went one step further and I changed remaining decimal divider from dot to coma.
    Uploaded new template to EBS.
    Repeated the procedure and only difference is that now error says:
    Caused by: oracle.xdo.parser.v2.XPathException: Cannot convert 0,00 to number.
    I was sure that decimal separator was cause of the problems but now I'm not so sure anymore.
    Any ideas?

  • Is the XSLT format-number function supported by XMLType.transform()

    I am trying to use the XSLT format-number function in a stylesheet via myXMLType.transform(myXSL) without any luck. For example, <xsl:value-of select="format-number($myNum,'#,###.00')/>. This works ok under the java based XSLT engine.
    Is format-number supported by XML DB?
    I am running 9.2.0.5.
    Cheers
    Anthony

    I have upgraded to 10g and found that this now works.
    Cheers
    Anthony

  • I have number range issue for fi posting.

    hi gurus,
    i have number range issue for fi posting (fb01,fb50).
    problem in updating table glpca due to duplication of record.
    INSERT GLPCA FROM TABLE T_GLPCA .
    With Regards,
    Shakthi Raj N.

    error msg  after generating document no and it is not getting updated in data base
    error msg
    "Express document "Update was terminated" received from author "ecciabap""
    Client.......   750
    User.....   ECCIABAP
    Transaction..   FB01
    Update key...   C83B07DE4DADF13CB4950017A4AB8015
    Generated....   02.03.2009, 20:37:23
    Completed....   02.03.2009, 20:37:23
    Error Info...   00 671: ABAP/4 processor: SAPSQL_ARRAY_INSERT_DUPREC

  • Functional Issues w/ IOS7

    Depending on how this discussion board works, I will attempt to update functional issues with this operating system.
    9/21/13: Alarm:  Setting the alarm is rather akward, the numbers are too rigid, fine, and small.  I feel the numbers being larger would be more user friendly.
    9/21/13 Calendar:  Previous version was superior in certain ways.  Shading out a part of the day which you typically don't use (ex:  1am-5:30am) would be great.  I feel lost in this update, it does not feel refined.  Please allow me to send an appointment through imessage already as well!

    Tell Apple.
    http://www.apple.com/feedback/iphone.html

  • Forum for functional issue

    Hi All!
    Is there any forum related to functional issues in SD and MM.Please do forward me the names if there are any.
    Regards
    Pavan

    Check these
    http://www.sapfans.com/
    http://www.erpfans.com/
    http://www.sap.com/community/default.epx?logonStatusCheck=0 (Login required)
    Regards,
    Vikas Madaan

  • Card Image Number and Issuer Id Number

    Hi
    I want to get card image number and issuer id number of jcop card, I have tried GP command as below but getting error. Any help
    cm> /send 80CA0042
    => 80 CA 00 42 ...B
    (9096 usec)
    <= 6A 88 j.
    Status: Reference data not found

    hi Thanks for replying,
    Command you guys have suggested gives information as below, but it still does not gives issuer identification number and card image number. (unique to chip)
    IC Fabricator : 4070
    IC Type : 5072
    Operating System ID : 4051
    Operating System release date : 4204 (22.7.2004)
    Operating System release level : 2200
    IC Fabrication Date : 5049 (18.2.2005)
    IC Serial Number : 00606190
    IC Batch Identifier : 7113
    IC Module Fabricator : 4070
    IC Module Packaging Date : 0000
    ICC Manufacturer : 0000
    IC Embedding Date : 0000
    IC Pre-Personalizer : 0317
    IC Pre-Perso. Equipment Date : 1430
    IC Pre-Perso. Equipment ID : 36303631
    IC Personalizer : 0000
    IC Personalization Date : 0000
    IC Perso. Equipment ID : 00000000

  • SGD 4.5 Desktop Functionality Issue

    I've come across an odd functionality issue on SGD 4.5. When I start "My Desktop" everything works fine. However if I start a new Full JDS Desktop session on another server, the JDS session doesn't appear to load correctly. New windows automatically open in the upper left corner and can't be moved. If I close both JDS Desktop sessions and open the other system first, then "My Desktop" session doesn't open windows properly. Has anyone come across this? It's not to big of deal right now, but it might become more of an issue when more users start using our SGD instance.
    Adam

    @JRoesler :
    The script for installing the users during installation when the users are not created is included some version before the 4.50.907
    The SGD version here is only 1 minor version before the latest release.
    @aspenhedge:
    If I look into the rpm (for Linux install) I don't see a check for a valid shell. It does however try to 'su' into those accounts. I might be wrong in this one.
    Can you manually use 'su ttaserv' and 'su ttasys' without any problem? Do these users have a valid home-dir for example.
    - Remold

  • HELP: Strange Number Formatting Issue

    G'day All,
    I have a stored procedure which is available via the web which generarates a customer report. I've just noticed that my number fields that have decimal values are being rounded to the nearest whole number.
    The SQL that grabs the data to be used in generating this specific table uses TO_CHAR(decimal_field, '9990.00') etc a number of times. example values are:
    0.27 becomes 0.00
    45.44 becomes 45.00
    I've double checked the underlying data and the values definitely have decimal values as the examples I listed above are from. When I run similar queries via the SQL COMMANDs web page the data is correctly formatted. It just appears to be with in the stored procedure.
    BUGGER I've just noticed that it is happing on "Report Regions" where I have also used TO_CHAR(decimal_Value, '99990.00') etc.
    Does anyone know WTF I've done or not done. I'm pulling my bloody hair out as "IT SHOULD JUST WORK!!" :(
    Regards
    Mark

    G'day Chrissy,
    Thanks for you response, I've just logged it the demo application on my local instance of apex v 3.0.1 on Oracle XE and and as you would have it, I cannot for the life of me get the Number Formatting issue to occur at home.
    So when I get back into work, I'll give your suggestion a go.
    That said, I've modified the DEMO application specifically the TOP 10 Product report using every combination of the TO_CHAR (your way, the ways that I believe I'm using) and it works fine. I've created a new table with decimal values and a new report and it works fine. I even tries putting records with null values in the decimal field, but it worked fine.
    I've just switched themes (even though themes have no influence of a dynamically create html page via procedure) annnnnd it works fine.
    AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!!
    Just maybe, just maybe it was Friday-itise and when I get in Monday it will just work, unless I get stung by Monday-itise :)
    I'll keep plodding along,
    Mark

  • (V7.X) PRIME NUMBER 를 생성해 주는 FUNCTION

    제품 : SQL*PLUS
    작성날짜 : 1998-09-22
    (V7.X) PRIME NUMBER 를 생성해 주는 FUNCTION
    다음은 input value x 보다 크면서, 가장 작은 prime number 를 return 해 주는 function 입니다.
    create or replace function lprime (x in number) return number is
    w number;
    i number;
    begin
         w := x;
         if w <= 2
         then
              w :=3;
              return w;
         end if;
         if mod(w,2) = 0
         then
         w := w +1;
         end if;
         loop
         i:=3;
         loop
              if (i*i) > w
              then
              return w;
              end if;
              if mod(w,i) = 0
              then
              exit;
              end if;
              i := i + 2;
         end loop;
         w := w + 2;
         end loop;
    end;
    실행의 예
    SQL> select lprime(10000) from dual;
    LPRIME(10000)
    10007

  • Connection Objects / Functional Location Number ranges Issue

    Hi ALL
    Number range object: ISU_EHAU is related to Connection Object / Functional Location  creation.
    But my client wants to create Connection Object number and functional Location  number with different number range series number.
    Can any one guide me how to proceed?
    Thanks In Advance
    KK

    Hi,
    As Connection Object & Device Location are functional locations so you have to be sure to map it to the same structure as defined in PM.
    The structure can be defined in PM through this path:
    Plant Maintenance and Customer Service -> Master Data in Plant Maintenance and Customer Service -> Technical Objects -> Functional Locations -> Create Structure Indicator for Reference Locations/Functional Locations                                                                                                    
    Here you can define your own edit mask for your structure for the functional location.
    according to the error message you got the Edit mask defined in your system must be XXXX-XXX-AA-NN.(kindly Check).
    X means you can enter both number and letters.
    A means only letters can be entered.
    N means only numbers can be entered.
    So try something like 1ABC-1A-QW-77(again check with the old number range that was defined)
    You can change the edit mask to 'XXXXXXX......XXXXXXXX'.(full field filled with X).
    and then I guess you can use the number range you have defined(as you wrote above) in the Connection Object number range(Object : ISU_EHAU)
    Kindly revert back for any clarifications.
    Regards,
    Rakesh..
    Edited by: Rakesh Dasgupta on Feb 12, 2011 2:41 PM

Maybe you are looking for

  • Weblogic portal 10.3.4 Domain creation issue

    Hi All, I have created the weblogic portal 10.3.4 domain with Oracle Data Base for the following connection pools (cgDataSource-jdbc.xml, cgDataSource-nonXA-jdbc.xml, p13nDataSource-jdbc.xml, p13nProfileDataSource-jdbc.xml, portalDataSourceAlwaysXA-j

  • HTML DB and Serial(COM) Port

    Hi, everyone, Is there any way that HTML DB can communicate with Serial Port (COM Port) directly? I searched the forum, and saw someone mentioned "Visual Baisc", "Javascript", "ActiveX", or "DLL". Could anyone give an example for it if you had succes

  • Add tab in header screen of MIRO

    Hi Experts,   I would like to add a new tab in header screen of MIRO transaction. is it possible.. ? if so, can any one please guide. Thankx Sal

  • Bulk uploads of Word docs to Portal

    my client wishes to upload approx. 50 word docs from their existing file server to Portal. ....manually posting the docs into an existing content area is prohibitive. Any hints on the most efficient way to bulk upload the docs into portal???? thanks

  • Windows 8.1 Drivers for DeskJet 842C

    I've just purchased a new Dell Inspirion 3647 with Windows 8.1 as a replacement for my old (no longer supported) Windows XP system.  My old DeskJet 842C printer doesn't appear to have drivers in Windows 8.1.  Has there been any drivers developed for