Help with rounding to nearest multiples of n-1 !!

i need help writing part of a program;
start with int n, then round ***up*** to the nearest multiple of n-1; then round **this** value up to the nearest multiple of n-2. (the final step is to round up to the nearest multiple of 2)
eg
if n=10;
9 -> 18
8->24
7->28
6->30
2->34.
Please help me with this, i'm really not sure where to begin !

it's a program to do with the approximation of pi;
so far i have;
public double pi (int n) {
double f; (this is the final value of the nearest
multiple of 2)
then from here i'm really not sure how to go about
it..... in other words i haven't gotten very far.Okay. I'm currious as to how this helps in the approximation of PI. Would you mind posting that?
I'll give you a few hints. The mod operator "%" tells you the distance a number is from the multiple of n immediately bellow a positive number.
The Math.IEEERemainder function tells you the distance a number is from the nearest multiple of n (whether above or below).
I'll leave it to you to figure out how to find the nearest multiple ABOVE the number, and how to use that to round the number. It's actually not all that hard.
- Adam

Similar Messages

  • I have a "Contact" organization issue I need help with.  I organize multiple customers under their account affiliation. I place the people with their contact info under each account name by their dept/role in the notes section of their account. I am l

    I have a "Contact" organization issue I need help with.  I organize multiple customers under their account affiliation. I place the people with their contact info under each account name by their dept/role in the notes section of their account. I am looking to be able to directly dial / email from this info in yet notes section located within a contact. On Blackberry, the notes area entered in a contact can connect directly but on the iPhone those numbers/emails are inactive. I am trying to avoid having to create each of these individuals as a separate contact and keep them under their account affiliation. It is easier to find them.  This does not seem like that complicated of a request and hoping someone can tell me how or share an app that will enable the "notes" within a contact be "active". Hope this makes sense.

    I seem to recall that this question has been asked before and I'm pretty sure that the answer is that you can't do what you want to do with the native contact app. However, there are lots of contact apps out there that pull from the built app's data but have other features. Perhaps one of them would meet your needs.

  • Need help with rounding of wage types in IT0008

    Hi,
    We have a requirement to round off wage type 1003 - Monthly Salary in IT0008. The amount entered in this wage type has to be rounded to the nearest 10's for India, 100's for Japan and 1000's for South Korea. For all other countries it should be rounded to the nearest whole number.
    I have tried this by setting up the Rounding Type to A/B/C and Rounding Divisor to 10/100/1000 in the wagetype characteristics table T511 for each of the above scenarios respectively but nothing worked.
    If we cannot find a way to set this up through configuration, we are planning to use the user exit in IT0008 to achieve this functionality. So anay ABAPER's also might pitch in for help...
    This is an existing wage type and we just need to apply rounding this time. Need expert advice pls...
    Thanks,
    Priya

    Actually A/B/C and 10/100/1000 should work but it start rounding off from decimal points. For example if you will put 1000 for round off then it will round off to 10.
    Btw since you are going with user exit, you can do it. What you need to do is read the wage type and indirect valuation module (as indirectly valuated wage type don't give you amount so you need to read module variant and valuate the wage type)  and then write the code for round off.
    Let me know if you need some more clarification on this.

  • Need help with Rounding a number.

    I have 3 cells each with a formula in them. Please bear with me while I try to explain this.
    Cell D18 contains the formula: =Sum(L18/C5) (L18's value is 58, C5's value is 10), So the value of the cell is 5.8. I need this number to round properly to 6. It does visually on the spreadsheet.
    Cell F18 contains the formula: =Sum(E18/F5) (E18=28, F5=8) So the actual value of F18 is 3.5 which is rounded to 4 visually on the spreadsheet.
    Cell G18 contains the formula =Sum(D18+F18). (D18 visually displays 6, F18 visually displays 4, therefore G18 should display 10). G18 actually displays 9. For some reason the calculations are still based on the actual calculations of D18 & F18, instead of the rounded displayed numbers. How do I get G18 to display the correct number of 10, rather than the rounded down number of 9?
    I'm sure there's a simple fix that I'm just not understanding. I hope I explained my problem well enough, I'd appreciate any help I can get. These numbers are to calculate insulin dosage, so I need to be sure the math is correct.
    Thanks in advance for any help!

    yvieinca wrote:
    I have 3 cells each with a formula in them. Please bear with me while I try to explain this.
    Cell D18 contains the formula: =Sum(L18/C5) (L18's value is 58, C5's value is 10), So the value of the cell is 5.8. I need this number to round properly to 6. It does visually on the spreadsheet.
    Cell F18 contains the formula: =Sum(E18/F5) (E18=28, F5=8) So the actual value of F18 is 3.5 which is rounded to 4 visually on the spreadsheet.
    Cell G18 contains the formula =Sum(D18+F18). (D18 visually displays 6, F18 visually displays 4, therefore G18 should display 10). G18 actually displays 9. For some reason the calculations are still based on the actual calculations of D18 & F18, instead of the rounded displayed numbers. How do I get G18 to display the correct number of 10, rather than the rounded down number of 9?
    The explanation is that you don't understand what you are doing.
    When you ask numbers to display 0 decimal, you don't ask it to round the contents but to display the rounded value.
    A contents remains 3.6 but the display is 4
    an other contents may be 3.6 too displaying 4
    When you sum, you ask number to add the contents (3.6 + 3.6) which is 7.2 and you ask it to display the rounded value of this result. So you correctly see 7 not 8.
    If you want to get what you described, you MUST force Numbers to round.
    First,I don't understand how you may invent such a silly thing like =Sum(L8/C5)
    You are asking Numbers to sum the result of the division L8/C5 to nothing.
    The correct syntax would ask it to calculate the quotient, no less no more.
    =L8/C5
    but here we need to round so, in D18, enter
    =ROUND(L8/C5,0)
    in F18, enter
    =ROUND(E8/F5,0)
    In G18, =Sum(D18+F18) is silly too.
    You are asking nummber to sum (D18+F18) and nothing.
    The correct formula may be:
    =SUM(D18,F18)
    or
    =D18+F18
    Yvan KOENIG (from FRANCE samedi 13 juin 2009 18:05:33)

  • Need help with rounding numbers in Java

    I finally have this program to where it needs to be except for one thing. The variable "freetime" isn't showing any kind of output in the applet. The variable sum and freetime are both called at the start of the program, and have equations to figure out the output for them, but only sum shows an output. I tried using brackets as opposed to multiple parentheses. What can I do to fix this so that there is an output? I was thinking of using something to round up the result, but I can't figure it out. Can anyone help?
    import java.awt.*;
    import javax.swing.*;
    public class FinalLab extends JApplet{
    String firstNum, secondNum, thirdNum, fourthNum, fifthNum;
    int personal, family, school, work, sleep, sum, freetime;
    public void init()
    String firstNum, secondNum, thirdNum, fourthNum, fifthNum;
    firstNum = JOptionPane.showInputDialog( "Enter total personal hours." );
    secondNum = JOptionPane.showInputDialog( "Enter total family hours." );
    thirdNum = JOptionPane.showInputDialog( "Enter total school hours." );
    fourthNum = JOptionPane.showInputDialog( "Enter total work hours." );
    fifthNum = JOptionPane.showInputDialog( "Enter total sleep hours." );
    personal = Integer.parseInt( firstNum );
    family = Integer.parseInt( secondNum );
    school = Integer.parseInt( thirdNum );
    work = Integer.parseInt( fourthNum );
    sleep = Integer.parseInt( fifthNum );
    sum = (personal + family + school + work + sleep);
    freetime = ((168-sum)/168)*100;
    public void paint(Graphics g) {
    super.paint( g );
    g.drawRect( 15, 10, 270, 20 );
    g.drawRect( 15, 35, 270, 20 );
    g.drawRect( 15, 60, 270, 20 );
    g.drawRect( 15, 85, 270, 20 );
    g.drawRect( 15, 110, 270, 20 );
    g.drawRect( 15, 135, 270, 20 );
    g.drawRect( 15, 160, 270, 20 );
    g.drawString( "Personal hours: " + personal, 25, 25);
    g.drawString( "Family hours: " + family, 25, 50);
    g.drawString( "School hours: " + school, 25, 75);
    g.drawString( "Work hours: " + work, 25, 100);
    g.drawString( "Sleep hours: " + sleep, 25, 125);
    g.drawString( "Total hours: " + sum, 25, 150);
    g.drawString( "Free time: " + freetime, 25, 175);
    }

    I am guessing that you really meant that you are seeing "Free time: 0" instead of what you said, which was that it wasn't showing any kind of output. (Your whole terminology is weird, you don't "call a variable" just for example.) If that's the case, it's because you are using integer division. You'll find that 27/168, for example, gives zero. I don't know why you are multiplying by 100 in your calculation and doing the division, perhaps you meant to return the free time as a percentage (in which case your output should say that), but since you are doing that you could do it this way:((168-sum)*100/168)Then you are doing 2700/168, which produces a reasonable number.

  • Help with a query.. (multiplication / division)

    Hi All, i have this data example
    CREATE TABLE "TB_CONVERSION_UNIDAD_TMP"
      ("ID_PRODUCTO"    NUMBER,
        "FLG_OPERADOR"   CHAR(1 BYTE) NOT NULL ENABLE,
        "NUM_FACTOR"     NUMBER(10,6) NOT NULL ENABLE);
    Insert into TB_CONVERSION_UNIDAD_TMP (ID_PRODUCTO,FLG_OPERADOR,NUM_FACTOR) values (null,'M','0,0001');
    Insert into TB_CONVERSION_UNIDAD_TMP (ID_PRODUCTO,FLG_OPERADOR,NUM_FACTOR) values (null,'D','1');
    Insert into TB_CONVERSION_UNIDAD_TMP (ID_PRODUCTO,FLG_OPERADOR,NUM_FACTOR) values (null,'M','1');
    Insert into TB_CONVERSION_UNIDAD_TMP (ID_PRODUCTO,FLG_OPERADOR,NUM_FACTOR) values (null,'M','2');
    Insert into TB_CONVERSION_UNIDAD_TMP (ID_PRODUCTO,FLG_OPERADOR,NUM_FACTOR) values ('79','M','1');
    Insert into TB_CONVERSION_UNIDAD_TMP (ID_PRODUCTO,FLG_OPERADOR,NUM_FACTOR) values ('17','M','100');
    Insert into TB_CONVERSION_UNIDAD_TMP (ID_PRODUCTO,FLG_OPERADOR,NUM_FACTOR) values ('16','M','10');
    Insert into TB_CONVERSION_UNIDAD_TMP (ID_PRODUCTO,FLG_OPERADOR,NUM_FACTOR) values ('16','M','1');
    Insert into TB_CONVERSION_UNIDAD_TMP (ID_PRODUCTO,FLG_OPERADOR,NUM_FACTOR) values ('78','D','48');
    Insert into TB_CONVERSION_UNIDAD_TMP (ID_PRODUCTO,FLG_OPERADOR,NUM_FACTOR) values ('18','D','100');
    Insert into TB_CONVERSION_UNIDAD_TMP (ID_PRODUCTO,FLG_OPERADOR,NUM_FACTOR) values (null,'M','1');
    Insert into TB_CONVERSION_UNIDAD_TMP (ID_PRODUCTO,FLG_OPERADOR,NUM_FACTOR) values (null,'M','11');
    Insert into TB_CONVERSION_UNIDAD_TMP (ID_PRODUCTO,FLG_OPERADOR,NUM_FACTOR) values (null,'M','1111');
    Insert into TB_CONVERSION_UNIDAD_TMP (ID_PRODUCTO,FLG_OPERADOR,NUM_FACTOR) values ('126','D','1111,19');
    Insert into TB_CONVERSION_UNIDAD_TMP (ID_PRODUCTO,FLG_OPERADOR,NUM_FACTOR) values ('40','D','2');
    COMMIT;
    /I want get the num_factor columns where's the condition i send is id_producto then validate if the column FLG_OPERADOR is 'M' or 'D' for the multiplication or division with the another parameter i send (val).
    so far i got this:
    set serveroutput on;
    DECLARE
    intFactor number(8,2);
    intID_Producto NUMBER(10):=126;
    strFlg_Operador CHAR(1);
    Cant number(8,2);
    Val number(8,2):=100;
    BEGIN
    select num_factor into intFactor from TB_CONVERSION_UNIDAD_TMP where id_producto=intid_producto and rownum=1;
    select flg_operador into strFlg_Operador from TB_CONVERSION_UNIDAD_TMP where id_producto=intid_producto and rownum=1;
    if (strFlg_operador='M') then
        Cant:=Val*intFactor;
    else
        Cant:=Val/intFactor;
    end if;
    dbms_output.put_line('Factor :' || to_char(intFactor) || ' Operador ' || strFlg_Operador || ' Total : ' || to_char(Cant));
    END;Thanks for the help.

    Wrong forum!
    This is the sql developer forum and is not for sql or pl/sql questions.
    Please mark this question ANSWERED and if the below doesn't answer your question repost the question in the sql and pl/sql forum.
    >
    I want get the num_factor columns where's the condition i send is id_producto then validate if the column FLG_OPERADOR is 'M' or 'D' for the multiplication or division with the another parameter i send (val).
    >
    You've got a good start. Now you just need to BULK COLLECT the data and loop thru it. By the way you don't need two separate queries.
    set serveroutput on;
    DECLARE
    intFactor number(8,2);
    intID_Producto NUMBER(10):=126;
    strFlg_Operador CHAR(1);
    Cant number(8,2);
    Val number(8,2):=100;
    type tbl_factor is table of number(8,2);
    type tbl_flg is table of char(1);
    t_factor tbl_factor;
    t_flg tbl_flg;
    intID1 NUMBER(10):=40;
    BEGIN
    select num_factor into intFactor from TB_CONVERSION_UNIDAD_TMP where id_producto=intid_producto and rownum=1;
    select flg_operador into strFlg_Operador from TB_CONVERSION_UNIDAD_TMP where id_producto=intid_producto and rownum=1;
    if (strFlg_operador='M') then
        Cant:=Val*intFactor;
    else
        Cant:=Val/intFactor;
    end if;
    dbms_output.put_line('Factor :' || to_char(intFactor) || ' Operador ' || strFlg_Operador || ' Total : ' || to_char(Cant));
    select num_factor, flg_operador bulk collect into t_factor, t_flg
    from TB_CONVERSION_UNIDAD_TMP where id_producto=intid1;
    for i in 1..t_factor.count loop
       if (t_flg(i)='M') then
           Cant:=Val*t_factor(i);
       else
           Cant:=Val/t_factor(i);
       end if;
      dbms_output.put_line('Factor :' || to_char(t_factor(i)) ||
      ' Operador ' || t_flg(i) || ' Total : ' || to_char(Cant));
    end loop;
    END;
    /

  • Need help with rounding up a number

    In my codes, there is a loop and when I cfdump the value, it
    looks like this:
    2.0,.3.0,4.0, all the way to 32.0, etc
    I need to use these number in a For Loop from="1"
    to="#ThisNumber#" but first I need to round it up so ThisNumber
    will come out as a whole number and not with the dot zero
    Is there a function in CF that can do this? Please help!

    alecken wrote:
    > In my codes, there is a loop and when I cfdump the
    value, it looks like this:
    > 2.0,.3.0,4.0, all the way to 32.0, etc
    > I need to use these number in a For Loop from="1"
    to="#ThisNumber#" but first
    > I need to round it up so ThisNumber will come out as a
    whole number and not
    > with the dot zero
    > Is there a function in CF that can do this? Please help!
    >
    A quick glance at the documentation for mathmetical functions
    turns up
    int(), floor() and ceiling() depending on how you would like
    to round
    different types of numbers.

  • Help with POST data if  multiple selections are chosen

    I've created a form with a menu (list) that includes all 50
    states. I'm using the POST option, along with PHP, to process the
    form data, which will be emailed to me. The list-menu looks like
    this:
    http://askdave.info/help/states_menu.gif
    and I have "Allow Multiple Selections" checked in the Property
    Inspector.
    If the user chooses multiple states, I want
    EACH of those states to be listed in the email that I
    receive. Right now, if I check multiple states, I only get
    the very last state that's selected. For example, here's the
    email I get after I check 5 different states.
    http://askdave.info/help/formdata.gif
    Problem--> In this email, only one state is listed
    (Hawaii) even though I selected 5 different states. How do I get
    the form data to list ALL states that are checked?
    Here is what I have:
    <form name="form1" method="post" action="process.php">
    <input type="hidden" name="required"
    value="name,phone,email,states,capital" />
    And then for the menu that lists the states, I have:
    <label>
    <select name="states" size="7" multiple id="states">
    <option>All States</option>
    <option>Alabama</option>
    <option>Alaska</option>
    <option>Arizona</option>
    <option>Arkansas</option>
    and so on...
    What am I missing? How do I get the PHP script to send
    multiple values, if multiple values are chosen? (I'm new to PHP, so
    go easy on me. I can post my code, if necessary.) Is this a PHP
    issue, or do I need to add something to the HTML form?

    Hi,
    >>
    I think DynaForm stands for Dynamic Form
    >>
    this makes some sense ;-) I was just wondering because there
    is a pre-made script called DynaForm
    here, but
    it has a different "logistics" than yours.
    However, both "DynaForm" versions are pretty basic, as they
    just deal with non-multiple values - form fields like single line
    input fields, texareas and non-multiple select´s. Your script
    e.g. just loops through all existing form fields using the
    "foreach" method:
    //Pulls form fields & values.
    foreach ($this->post as $field => $value) { // looping
    through all form fields
    if ( $field == 'required' ) continue;
    $this->_addLine($field, $value); // here´s where the
    field´s name/value consolidation happens
    ...and simply consolidates a field´s "value" with its
    associated "name". The problem is : this method just works for
    fields having just 1 value -- but any "multiple value" form fields
    (e.g. your "states" select or checkbox groups which can pass
    multiple values as well) actually require a separate "foreach"
    treatment within the script, and this hasn´t been incorporated
    here.
    That said, I suggest using an other pre-made solution like
    PHP
    Form Mail script that´s capable to handle your multiple
    values - scenario innately.

  • Help with Contacts - IDs and Multiple Accounts

    Hello
    I am involved in the process of migrating accounts and contacts into ByDesign, but have come across a couple of questions that I can't seem to find an answer to anywhere!
    Firstly, is it possible to specify the 'Contact ID' reference range. I have found how to set the Account ID for suppliers and customers, and also how to set the Employee ID for employees within Fine Tuning, but cannot seem to find the same feature for the Contact ID. Is it possible to set this field up to have a certain amount of digits, and between certain values when automated?
    My other question regards having contacts linked to more than one account. I understand it is possible to have a contact linked to multiple accounts, but how? Is it possible from the Migration Templates? Is it a simple case of using the same Contact ID and information, but differing Account IDs on the 'Contacts' tab of the Template?
    Any help is much appreciated.
    Thanks
    Andrew

    You should not be using some other user's icloud account on your devices.  That's not how icloud is designed, because if you edit/delete data on the device that ties to the other user's icloud account, then those changes will automatically sync to their devices - something I don't think you two want happenning.
    If you want to keep your work data separate from personal data, then depending on what databases you want to use, like contacts or calendars, you could use a single icloud account and define groups in contacts, for exampe, some for work and some for personal.  Same thing with calendars, define different calenders for each environment.  Some databases like email may be problematic, however, I would think that work emails involve a non-icloud email account, so you could use the icloud email for personal use.
    The other approach is to define and use two icloud accounts and for each device, decide which account to use.  Having one device that uses both work and personal data would be a problem.

  • Help With split tunneling and multiple subnets behind asa

    Hello All,
    our vpn clients can no longer access internet while connected to vpn.
    I was hoping I could get an answer on here for an issue we are having. let me explain this with as little words as possible.
    here was old network layout:
    ASA
    192.168.1.1   ---->  the rest of the internal subnet (was only subnet in network)
    now
    ASA                              3560
    192.168.254.1/24 ----->192.168.254.2/24-->192.168.1.1/24
                                                                   192.168.2.1/24
    so what we did was route from 3560 to asa  so we would be able to have multiple subnets since our asa has base license.
    Our vpn with easy connect worked with our split tunneling before and now we made the change above and it no longer works. Can someone help me out as to why it no longer works and what changed need to be made to make it work.
    Thank you.
    ciscoasa# sh run
    : Saved
    ASA Version 8.2(2)
    hostname ciscoasa
    enable password 1N7bTm05RXLnBcUc encrypted
    passwd 2KFQnbNIdI.2KYOU encrypted
    names
    interface Vlan1
    nameif inside
    security-level 100
    ip address 192.168.254.1 255.255.255.0
    interface Vlan2
    nameif outside
    security-level 0
    ip address x.x.x.x 255.255.255.248
    interface Ethernet0/0
    switchport access vlan 2
    ftp mode passive
    clock timezone est -5
    same-security-traffic permit intra-interface
    access-list NoNat extended permit ip any 172.16.5.0 255.255.255.0
    access-list SplitTunnel standard permit 192.168.1.0 255.255.255.0
    access-list SplitTunnel standard permit 192.168.2.0 255.255.255.0
    access-list SplitTunnel standard permit 192.168.254.0 255.255.255.0
    pager lines 24
    logging asdm informational
    mtu inside 1500
    mtu outside 1500
    ip local pool VPNPool 172.16.5.1-172.16.5.254 mask 255.255.255.0
    icmp unreachable rate-limit 1 burst-size 1
    no asdm history enable
    arp timeout 14400
    global (outside) 1 interface
    nat (inside) 0 access-list NoNat
    nat (inside) 1 0.0.0.0 0.0.0.0
    route outside 0.0.0.0 0.0.0.0 x.x.x.x 1
    route inside 192.168.1.0 255.255.255.0 192.168.254.2 1
    route inside 192.168.2.0 255.255.255.0 192.168.254.2 1
    timeout xlate 3:00:00
    timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
    timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
    timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
    timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute
    timeout tcp-proxy-reassembly 0:01:00
    dynamic-access-policy-record DfltAccessPolicy
    http server enable
    http 192.168.1.0 255.255.255.0 inside
    no snmp-server location
    no snmp-server contact
    snmp-server enable traps snmp authentication linkup linkdown coldstart
    crypto ipsec transform-set TransformSet1 esp-3des esp-md5-hmac
    crypto ipsec security-association lifetime seconds 28800
    crypto ipsec security-association lifetime kilobytes 4608000
    crypto dynamic-map DynamicMap1 1 set transform-set TransformSet1
    crypto map MainMap 999 ipsec-isakmp dynamic DynamicMap1
    crypto map MainMap interface outside
    crypto isakmp enable outside
    crypto isakmp policy 10
    authentication pre-share
    encryption 3des
    hash sha
    group 2
    lifetime 86400
    telnet 0.0.0.0 0.0.0.0 inside
    telnet timeout 5
    ssh timeout 5
    console timeout 0
    threat-detection basic-threat
    threat-detection statistics access-list
    no threat-detection statistics tcp-intercept
    ntp server 64.90.182.55 source outside
    webvpn
    enable outside
    svc image disk0:/anyconnect-dart-win-2.5.0217-k9.pkg 1
    svc enable
    tunnel-group-list enable
    group-policy RenotreUsers internal
    group-policy RemoteUsers internal
    group-policy RemoteUsers attributes
    vpn-tunnel-protocol svc webvpn
    split-tunnel-policy tunnelspecified
    split-tunnel-network-list value SplitTunnel
    tunnel-group RemoteUsers type remote-access
    tunnel-group RemoteUsers general-attributes
    address-pool VPNPool
    default-group-policy RemoteUsers
    tunnel-group RemoteUsers webvpn-attributes
    group-alias Southeast-Security-VPN enable
    tunnel-group RemoteUsers ipsec-attributes
    pre-shared-key *****

    I think it could be your NAT statement. You should try an avoid using any unless you tunnel everything. Try making this change
    no access-list NoNat extended permit ip any 172.16.5.0 255.255.255.0
    object-group network INTERNAL_NETWORKS
    description Internal Networks
    network-object 192.168.1.0 255.255.255.0
    network-object 192.168.2.0 255.255.255.0
    network-object 192.168.254.0 255.255.255.0
    access-list NoNat extended permit ip object-group INTERNAL_NETWORKS 172.16.5.0 255.255.255.0
    You may have to re-add your NAT0
    nat (inside) 0 access-list NoNat

  • Query help with round up of dates

    Hi,
    I have a problem with my query.
    I am calculating the difference between two dates and I want to get the hours.
    The problem is that I want the following to happen:
    if the difference is x such that x > 0 it should round it up to 1 (example: x = 0.1 it should be rounded up to 1)
    if the difference is y such that y >1 it should be rounded to 1 (example y = 1.05 it should be rounded up to 2)
    i have the following query at the momet:
    select to_char(arrivaldate,'DD/MM/YYYY hh24:mi:ss') as "ARRIVAL", to_char(departuredate,'DD/MM/YYYY hh24:mi:ss') as "DEPARTURE", round(trunc(mod((departuredate-arrivaldate)*24,24),2)) as duration from stay_log;
    thanks.

    Hi,
    Format your code so that the physical appearance of the code gives some hint as to what you're doing, as I did below.
    When posting code on this forum, always type &#123;code&#125; tags at the beginning and end of formatted sections.
    Do you mean that, instead of 21, you want to use the flightid from the main query?
    If so, that's called a "correllated query". The tables in the main query (and their columns) can be reference in the sub-query, like this:
    select     flightid                         as "FLIGHT",
              select     destairport_id
              from     journey,
                   flight
              where     flight.flightid  = stay_log.flight_id   -- correlated to main query
              and     flight.journeyid = journey.journeyid
         )                              AS "AIRPORT",
         to_char(arrivaldate,'DD/MM/YYYY hh24:mi:ss')     as "ARRIVAL",
         to_char(departuredate,'DD/MM/YYYY hh24:mi:ss')     as "DEPARTURE",
         ceil((departuredate-arrivaldate)*24)          as "DURATION",
         cost                              as "COST"
    from     stay_log;Often, people give a table alias to the main query table that is being referenced in the sub-query, as shown below.
    That's only required when the table name appears in both FROM-clauses.
    select     flightid                         as "FLIGHT",
              select     destairport_id
              from     journey,
                   flight
              where     flight.flightid  = s.flight_id     -- table alias s used here
              and     flight.journeyid = journey.journeyid
         )                              AS "AIRPORT",
         to_char(arrivaldate,'DD/MM/YYYY hh24:mi:ss')     as "ARRIVAL",
         to_char(departuredate,'DD/MM/YYYY hh24:mi:ss')     as "DEPARTURE",
         ceil((departuredate-arrivaldate)*24)          as "DURATION",
         cost                              as "COST"
    from     stay_log   s     -- table alias s defined here
    ;

  • Help with sending emails to multiple users.

    Currently we have a process to send mail to muliple users by looping through the list of users and sending each individual an email
    <Action id='1' name='sendEmail' application='com.waveset.provision.WorkflowServices'>
    <Argument name='op' value='notify'/>
    <Argument name='template' value='$(template)'/>
    <Argument name='toUser' value='$(tuser)'/>
    <Argument name='catch' value='notificationException'/>
    </Action>
    The variable tuser contains a single email address.
    Is there any way to setup tuser to contain multiple email addresses?
    I have tried passing a list and a string separated by colons (ex: <s>[email protected]; [email protected]</s>) and neither one works.
    Question 2
    Is it a bad idea to try and send email to up to 50000 users at once using IDM? Besides the fact that I would need to search for specific users and get their email addresses based on their capabilities.

    Hi,
    For sending emails to multiple users, use to instead of toUser. Put the names in comma seperated values
    <Action id='0' application='com.waveset.provision.WorkflowServices'>
    <Argument name='op' value='notify'/>
    <Argument name='template' value='$(template)'/>
    <Argument name='to' value='$(to)'/>
    <Argument name='cc' value='$(cc)'/>
    <Argument name='catch' value='notificationException'/>
    </Action>
    You can use IDM to send emails.
    it will be a good idea to break down the email that you are sending into groups/batches. If possible, you can send email to DL s
    Else, you can segregate the users based on roles and send emails. This will reduce the load. Hope it helps
    Regards
    Arjun
    Edited by: arjun.sengupta on Dec 4, 2012 3:26 AM

  • Need help with Adobe documents - emailing multiple PDFs

    Can anyone out there help an old man? I'm new to all things Adobe but the only thing I can't seem to master is sending multiple PDFs in a single email, from Adobe documents. What am I missing here?

    Hi Craig,
    You can either Create a pdf portfolio of those files and send a single file to the user or you can select all the files you want to send at once while uploading and then send them in one go.
    Please revert back if you still face challenges in sending multiple pdf files at once.
    Regards,
    Rahul

  • Help with jfree regarding plotting multiple lines in a line graph

    hi,
    i have
    < time>
    < volume>
    i have sucessfully used this data to plot a line graph(1 line)
    now i have
    <time> <time2>
    <volume> <volume2>
    how do i put this values into a single line graph? that means, i will have a line graphs with 2 lines.
    Help appreciated. Thanks Alot

    any help? still need help. thanks

  • Help with header field on multiple pages

    I am trying to print three multiple page documents.  The first document in the dat file has data in a header comment field.  The last two documents in the dat file do not have data for the header comment field. On the form I have defined this comment field as global.  When I print the documents the first document comment is being printed on the last two documents that should not have comments.
    If I remove the global condition for the comment field, then the comment is only printed on the first page of the first multiple page document.  Is it possible to print the comment on each page of the first multiple page document and not print the comment on the documents that should not have a comment?  Thanks for any help.

    Got it. Thank you. I'm having one other problem though. I
    keep getting this bizare message every time i save or try to use
    the template:
    The is an error at line 41 column 7 (absolute position 2486)
    of "~pathandfilename.dwt": Nested editable regions
    The only thing at line 41 is the <body> tag. I took all
    the formating out to try to trim this out... any thoughts about
    this one.
    Thanks G

Maybe you are looking for

  • Microsoft office 2008 and OS X 10.8.3

      microsoft office 2008 worked on my i-mac until I upgraded to lion 10.8.3. any easy fix?

  • PS ; Network Activities (Internal & external) monitoring or evaluation

    Hi Can any one guide me how to  pull out a std report for viewing the dates maintained in Activities (Internal & external) in Network, planned dates vs actual dates of confirmation of activities. Pl help Srihari

  • No (NEW) Images in Aperture galleries

    Anyone have ideas on how to fix the media sharing between Aperture and iWeb? Since installing the Aperture 3 trial, I cannot see any new images in the iweb media browser - only images that were imported prior to installing the trial. Now that I've go

  • Passing Values to a dropdown list within a dialog box

    I am using the app.execDialog(dialog1) command to display a dialog box on my form. The dialog box contains dropdown list (popup). I have found examples that do this but in all the examples they reference the loadDefaults function with hardcoded value

  • Grouping synced audio + video clips into one clip?

    I've been asked to edit some footage together that was shot by some other people. They recorded the audio separate from the video on a Marantz device, but they used a clapboard to mark everything so it shouldn't be too much of a problem to sync the a