Rounding to the nearst 5 multiple

Hi to all,
I need to round a number to the nearst multiple of 5. How this is possible. I have tried with round and trunc funtion it is rounding to the 10th multiple..
If I have a number 12.59 it should round to 10, if I have a number 13 and above till 15 it should round to 15.
kindly help me in this regard.
Thanks
Vijay

Vijayaraghavan Krishnan wrote:
ya peter but my client is asking me like that.
it is possible to round to 15 if it is greter than 10? (i.e. 11 -15 to 15. 16-20 to 20)This:
with my_tab as (select 12.5 num from dual union all
                select 13 num from dual union all
                select 12.49 num from dual union all
                select 15.13 num from dual union all
                select 10 num from dual)
select num,
       ceil(num/5)*5 rounding_up,
       ceil(floor(num)/5)*5 rounding_mostly_up
from my_tab
       NUM ROUNDING_UP ROUNDING_MOSTLY_UP
      12.5          15                 15
        13          15                 15
     12.49          15                 15
     15.13          20                 15
        10          10                 10Edited by: Boneist on 26-Feb-2009 11:48
added in second column, depending on whether 15.<something> is supposed to round up to 20 or down to 15

Similar Messages

  • Multiple tables with the possibility of multiple records in each table

    Post Author: viper
    CA Forum: .NET
    Hi
    I have been trying for a few days now to come up with a CR solution to displaying data from multiple tables.  These tables, in some cases, have more then one record that needs to be displayed.  This is basically what I am trying to do.....
    I am developing a .net web application(vb) using vs2005 and an oracle 10g backend.  There is a data entry part of the site that users will enter data related to a property.  Other users will be able to search these records and have a list of records returned based on the search criteria.  The user then can click on one of these records to view a pop up CR report containing all the data related to that one property.  The PropID is passed to the pop up page and is used in the WHERE clause of my SQL statement to bring back only one property.  This data can come from as many as 18 tables if all the fields have been entered for this property.  I have tried many different solutions to get the data from multiple tables...and have had some that were close to what I need.  The best one I have will display data from multiple tables but only one record per table.....which doesn't work in my case since some of the tables have more then one record per table.
    Is there anybody that has had success in setting up similar reports?
    Does anybody know how I could use the "Group Expert" to group by the tables in my application?  I can only figure out how to group within a single table.
    It would be great if I could group by table....then just display the record(s) in each table that had the same PropID.  I am not sure if the pdf export would show all the data in that situation but it would be worth a try.  If fact...maybe I could create a new table called MyTables and just add two colums like MyTableID and MyTableName.  Then add all the table names to MyTables that I want to see in the report and add the associated MyTableID value to each table as a new column.  I could then group by MyTableID and PropID.  Just guessing here.
    Any ideas would be appreciated.

    Post Author: quafto
    CA Forum: .NET
    Your query is not too clear so I'll do my best to answer it broadly.
    You mentioned that you have a .NET web application where your users enter data on one screen and then may retrieve it on another. If the data is written in real time to a database then you can create a standard Crystal Report by adding multiple tables. The tables should be linked together using the primary and foreign keys in order to optimize the database query and give you a speedy report. Using unlinked tables is not recommended and requires the report engine to index the tables (it is quite slow).
    You also mentioned you have a "PropID" to be used in a WHERE clause. This is a great place to use a parameter in your report. This parameter can then be used in your record selection formula inside Crystal Reports. The report engine will actually create the WHERE clause for you based on the parameter value. This is helpful because it allows you to simply concentrate on your code rather than keeping track of SQL queries.
    Now, what Crystal does not do well with is uncertainty. When you design a report with X number of tables the report engine expects X number of tables to be available at processing time. You should not surprise the print engine with more or less tables because you could end up with processing errors or incorrect data. You may need to design multiple reports for specific circumstances.
    Regarding the group expert question. I'm not sure how you would/could use the group expert to group a table? A table is a collection of fields and cannot be compared to another table without a complex algorithm. The group expert is used to group and sort records based on a field in the report. Have a look at the group expert section of the help file for more information.
    Hopefully my comments have given you a few ideas.

  • How to get the data from multiple nodes to one table

    Hi All,
    How to get the data from multiple nodes to one table.examples nodes are like  A B C D E relation also maintained
    Regards,
    Indra

    HI Indra,
    From Node A, get the values of the attributes as
    lo_NodeA->GET_STATIC_ATTRIBUTES(  IMPORTING STATIC_ATTRIBUTES = ls_attributesA  ).
    Similarily get all the node values from B, C, D and E.
    Finally append all your ls records to the table.
    Hope you are clear.
    BR,
    RAM.

  • How can I change the length of multiple lines at the same time?

    This just seems like it should be a no-brainer, but obviously for me it isn't.  I'm trying to change the length of multiple lines, that are at different angles, at the same time, in CS4.  Basically, I design the face of dials used for airplane instrument gauges (like RPM, Torque, etc), and they have gradiation marks (lines) located all around, similar what a clock looks like with the hour and minute gradiation marks (lines).  Is there a way to select all the lines, that I know are the same length, and change it to a different length, that's accurate to the 1/100th of an inch?  It would just be like selecting multiple lines that have all the same stroke, then using the stroke box to change the stroke weight from .025in to .030in.
    I've used the transform box to change the 'height' of a line before, but the line has to be at 90 degrees (straight up and down), and that won't work for the lines that are at, say, a 45 degree angle.
    I hope i'm explaining this in a way that someone will understand. If not, I can sure try to clarify more, or insert the picture so you could see what i'm talking about.
    Thanks for any help you can give!

    OK, after fiddling around with everyone's ideas, I think I finally got it. I knew there had to be something with proportions between W and H, but couldn't figure out the math, until Jacob answered with:
    "If each line must be strecthed from the inner/outer end, you may select each and use the Transform palette, choosing the right Reference Point, multiplying by the proportion in W or H (1.75/1.5), and Ctrl/Cmd clicking."
    Now, I basically did everything above, (but I couldn't figure out what you were talking about with the Ctrl Clicking thing), except after figuring out the right proportion (which ends up being so small you guys would die if I told you the number; the numbers I gave earlier were just an example and much larger than what i'm really working with) I just clicked the little chain next to the W and H boxes to constrain the proportions. I then put the new number (multiplied proportion by whatever was in W) in the W box. The line lengthened perfectly toward the center of the dial, keeping the correct angle!
    And Harron-Thanks for the link to Teri's, It is going to help with some things I do, but most of the dials I design don't have equal distances between each gradiation mark, and the blueprints I work off of usually have exactly what distances that the grad. marks are supposed to be. So, after selecting one of my grad marks that is already at it's correct place, I then use the rotate tool and Alt-Clicking the very center of the dial, I can then put in exactly what distance I want the next grad. mark to be at, I hit copy (instead of OK) and there will be a new grad. mark exactly the correct distance from my original. Then if I want to have the 3rd grad. mark I just hit Ctrl-D and it will copy another mark to the next position. I don't know if you necessarily wanted to know all that, but i thought i'd explain why I like doing it that way.
    A BIG thanks to everyone! I'm really a AI newbie and am the only one at my company that knows how to use it, so I don't have anyone close to ask stupid questions to. So I appreciate all your help!

  • Why is Apple TV showing the same computer multiple times for Home Sharing?

    Why is my Apple TV showing the same computer multiple times for Home Sharing? Also have connectivity issues. Sometimes will lose signal.
    JonRod's music
    JonRod's music
    JonRod's music
    JonRod's music
    JonRod's music
    I recently updated to Yosemite and never had this issue before.

    I'm not 100% sure of the ins and outs, but it's some sort of known issue between Yosemite, Airport and wifi. All you can do is wait for a fix and keep restarting your equipment as and when needed, unless you have the ability to connect your Mac via ethernet.

  • If I buy creative cloud student plan, can I use the software on multiple computers. I have 2 laptops for school.

    If I buy creative cloud student plan, can I use the software on multiple computers. I have 2 laptops for school.

    Creative Cloud Help | Creative Cloud / Common Questions
    Can I use the software I download from Creative Cloud on more than one machine?
    Yes. Creative Cloud desktop applications can be downloaded and installed on multiple computers, regardless of operating system. However, activation is limited to two machines per individual associated with the membership. See the terms of use for more information. Learn how to deactivate a Creative Cloud license on a machine.

  • Can I gift the same app multiple times to multiple users?

    Can I gift the same app multiple times to multiple users?
    Like, if I wanted to buy iMovie for 3 friends, could I buy the app as a gift 3 times?

    You should be able to gift it multiple times
    Gifting content : http://support.apple.com/kb/HT2736

  • How can I change the font to multiple titles at the same time?

    Hey guys, quick question. I have a bunch of titles and lower thirds in my project and my producer decided that he didn't like the font we were previously using and wants to change it to a new one. He seems to do that pretty often. Is there a way to "globally" change the font to multiple title cards at the same time instead of clicking on each one separately and doing it manually for each one? And if there is no way to do that does anyone have any ideas on how to make it easier?

    If you have any idea of design and fonts you would understand that "Title Cards" are not "exactly the same" if you change the font... because all fonts are not equal! Lower thirds are probably even more restrictive because they have design elements in them.
    If you work with "change their mind producers"...the deal that goes with that is suck up their changes. (on a salary or otherwise)
    I was just saying there is no way without scripting ..to change a title ( graphic) en masse ( in Premiere) and get it working because of font differences.

  • How to keep all text and formats the same on multiple computers?

    I'm creating a file in InDesign CS6 on my Windows computer. I keep everything on my flash drive. When I go to school, I bring my flash drive with me and open it up on the Mac computer, but then there are are compatibility issues. There seems to be missing fonts and formats but the school uses the same version of InDesign I do. Now I was told a lot of things of how to keep the fonts and formats the same (embed the links, package the files, outline the text, save as IDML). However, it is not clear to me what each of those options do, so I don't know when or why to use them. So I just want to make sure that when I bring in my file in next Monday, I won't have any missing fonts or formats. What would you suggest is the proper things to do to keep everything the same on multiple computers? And could you please explain why?

    If you want cross-paltform comaptibility limit the fonts to OpenType or Windows TrueType formats, both of which work on both Mac and PC. To avoid missing font warnings the fonts must either be installed on each computer, or they must be in a folder named Document Fonts in the same location as the .indd file they are to work with. Packaging the file will build taht folder for you.
    the rest of the stuff in your list won't help you. .idml would allow you to open on an older version, but does nothing for your situation. Embedding the links will keep you from having missing links, but so will packaging, and embedded links will make the file much larger and harder to work with.
    For goodness sake, don't even think about outlining the text. It stops being text when you do that and you can no longer edit it.
    And finally. do yourself a big favor and don't attempt to actually work on your file directly from the flash drive. Copy the whole package folder to the hard drive, work on it, then copy back. You don't want to know how many files are fatally damaged by write errors on flash drives.

  • How does iCal, or Calendar, order the display of multiple events for the same time?

    I can't for the life of me figure out how iCal orders the display of multiple items at the same time.  Does anyone have a clue?  It's not alphabetical.  It's not according the the order of the calendars in the left pane.  Is it just random?  Any help would be greatly appreciated.

    In the focus lost eventhandling start a thread which does
    the actual handling.
    the new thread waits for a little time (0.1 seconds)
    the click event of the button checks for a thread like the one above and tells it not to execute
    This way you execute the for the lost focus event only if
    the ok button isn't clicked in the same process ... not
    realy good, because it kind of relies on the ordering of threads ... but maybe it still works for you?

  • Is there a way to create folders on one iPad and sync the folders to multiple iPads?

    Is there a way to create folders on one iPad and sync the folders to multiple iPads? I have 23 iPads and I want to have all the folders match for easier access for students.

    Here is a possibkle workaround, assuming the iPads are all starting out with the same initial content on them:
    Backup that iPad to each computer you will be using. Then restore from the backup (only takes a couple minutes). Then rename the other 22 iPads.

  • Is it possible to view the content of multiple lists(located in multiple webs) in one ListViewWebpart? And how can I filter a multivalue column?

    Is it possible to view the content of multiple lists, that are located in different webs as well, in just one ListViewWebpart? Could I maybe change the query programmatically so that it get's the content this way?
    I know that I could use the Content Query Webpart instead - actually I have been using that so far, but the problem is, that it brings no standard Sharepoint functionality for lists with it... I had to write the xsl style sheet, there are no dynamic filters
    that the user could set, there are no default list operations the user could use.
    The ListViewWepart has all of these, but it only shows the content of one list...
    And my second problem:
    One column can contain multiple values (like a column that contains multiple users or user groups that are related to one entry). I can filter every other column with the standard filters, but not the column with multiple values in it. Is it possible to
    activate that or maybe add this feature programmatically?

    You can fetch data from multiple lists in ListViewWebpart, this can be possible through Content Query web part or Custom Web Part using visual studio but in that case you can not get the standard SharePoint funcationality for list (which is available in
    ListViewWebparts).
    No OOB filter available for multi-choice column, you also have to go with custom solution to achieve this.
    Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer.

  • Credit Memo with the reference of multiple Billing document

    Hi SD Gurus,
    I wanted to create credit memo with the reference of multiple billing document for a single customer.
    Is it possible in standard SAP? If YES please tell me HOW…
    Thanks in advance...
    Ratish Patil

    hello, friend.
    yes, you actually can.  first you enter VA01 and choose the document type.  press ENTER.
    then in the order Overview screen, go to SALES DOCUMENT > CREATE WITH REFERENCE.  a dialog box will ask you which billing document you want as reference.  enter the document number and press COPY.
    you can repeat this process as many time as you wish.  the items of the referenced documents will be copied into your Sales Document.
    hope this helped.  reward if useful.
    jty

  • Distributing the GOA to multiple locations in the same backend

    Hello Folks,
    We are implementing SRM 5.0 (SAPKIBKT10 Support Package level) with Extended Classic Scenario, with only one backend system (R3 V4.6b) integrated with the SRM system.
    Queries:
    At GOA header - Distribution,  Example is shown below....
    Backend Purchase Organization 1 - Location A
    Backend Purchase Organization 1 - Location B
    When we distribute one GOA to the backend with multiple locations for the same Purchase organiation.
    In the backend system two idocs are getting generated with the same contract number. While processing the first Idoc the system is creating the contract but while processing the second idoc the system is changing the previously created contract, instead of creating a new contract.
    So, in standard does the system creates actually creates two contract numbers for two different locations?
    Can somebody throw some light on the logic of the distribution
    Regds
    Amith
    Edited by: Amith Varma on Feb 26, 2008 4:51 AM

    Hi Amith,
    this is normal behaviour of the system in the case POrgs are set up accross company codes. In the Contract IDoc the Comany Code is derived from the location. When the system finds the same company code, it does not create an additional contract, but just updates the already distributed contract.
    Cheers,
    Claudia

  • Service procurement for the free texts ( Multiple line items in PO)

    In the service procurement for the free texts ( Multiple line items in PO)referring to the same  Contract we are cretaing the POs
    thro ME59 ( Program RM06BB20)  an unusual error message appears as under:
    "_Material/Service group STGOP2 does not exist"_This Material group is unavailable in T023 as well.
    We checked the same issue by recreating with the exact data in the Test environment and everything works OK
    We are working on the R3 version 470...
    Any body faced such an issue ?
    Any clues pls?
    Regards,
    Nagarajan

    Hello,
    We have faced another issue of the same nature while a PO is being created using the tcode ME21N for service free text items referring a PR ( Service item has no Contract assigned but a fixed vendor)
    The error relates to SE419 ( Mat grp 'XXXX' does not exist)
    Any takers..
    We are using a custom doc type  for the PR
    Any hep /clue is appreciated
    Regards,
    Nagarajan

Maybe you are looking for

  • How can I get rid of the watermark in my project after purchasing the license?

    Hi, I have to do a video project for work - started it with the trial version and now we have acquired the lincense but it did not dissapear. Can someone help me? Customer support was unfortunately very unhelpful and rude. Thanks

  • Help, Itunes wont recognise Iphone 4s

    When I connect my Iphone 4s to my PC iTunes doesnt recognize it. I followed a lot of tutorials online but when I try to install the Apple Mobile Device USB Driver it gives me a code 37 error. I have no idea what else to do, can anyone help me?

  • Need to rasterize type in Flash CS4

    I have not used Flash in a while...been trying to rasterize type so I can do a shape tween on it... help?

  • Illustrator CC crashes on launch on Mac 10.7.5

    Just today my Illustrator CC started crashing on launch. First time it happened Adobe directed me to a fix: Illustrator 17.1 stability fix (Mac-only) I did as directed, but with no effect. What now?

  • 7.5 won't install on windows 2000, can I still sync my ipod?

    My ipod wouldn't be recognized by my Itunes, therefore stopped syncing with that older version of Itunes. I went through the troubleshooting, uninstalled my Itunes, attempted to install version 7.5 but was cut off when I was told I needed Windows XP