create columns to use in the calculations

Would appreciate help with this project. How to combine queries and add a 2 additional columns to store the results of calculation?

In functional terms, to do the sum of the selected retirement pay for a deduction BDCA R03 code to arrive at total monthly for these deductions.

In other words, the data of payroll deductions amount for 2 periods of payroll PATRICK = 21 & 22 (EMPLOYEE_AMT and EMPLOYER_AMT) and the totals in the new columns are named EENOVR03 and ERNOVR03. Column names EA representative for employee, ER for the employer, for November NOV and R03 for deduction code.

Thanks to all those who can help you.

This is the SQL base without calculations. I need to change SQL to produce the EENOVR03 and the ERNOVR03.

Select SPRIDEN. SPRIDEN_LAST_NAME "LastName."
SPRIDEN. SPRIDEN_FIRST_NAME "FirstName."
SPRIDEN. SPRIDEN_MI "MiddleName",.
SPRIDEN. "CWID SPRIDEN_ID."
PHRDEDN. PHRDEDN_YEAR 'year ',.
PHRDEDN. PHRDEDN_BDCA_CODE "DedCode"
PHRDEDN. PHRDEDN_PAYNO "PayrollNo"
PHRDEDN. PHRDEDN_EMPLOYEE_AMT "EE21R03"
PHRDEDN. PHRDEDN_EMPLOYER_AMT "ER21R03".
of payroll. PHRDEDN PHRDEDN,
SATURN. SPRIDEN SPRIDEN
where SPRIDEN. SPRIDEN_PIDM = PHRDEDN. PHRDEDN_PIDM
and PHRDEDN. PHRDEDN_YEAR = '2011'
and PHRDEDN. PHRDEDN_PAYNO = '21'
and PHRDEDN. PHRDEDN_BDCA_CODE = "R03".

Above SQL
Lines of John Doe:

YEAR PATRICK BDCA EEAMT ERAMT

2011 21 R03 100 150
2011 22 R03 130 200

Result would be:

NAME = John A. Doe
ID 1234
YEAR 2011
EE21R03 100
EE22R03 130
EENOVR03 230
ER21R03 150
ER22R03 200
ERNOVR03 350

Published by: Rowena December 4, 2011 06:42

Published by: Rowena December 4, 2011 06:49

This looks like a hub for me. One way is:

select spriden.spriden_last_name "LastName",
       spriden.spriden_first_name "FirstName",
       spriden.spriden_mi "MiddleName", spriden.spriden_id "CWID",
       phrdedn.phrdedn_year "Year",
       sum(case when phrdedn.phrdedn_payno = '21'
                  then phrdedn.phrdedn_employee_amt end) "EE21R03",
       sum(case when phrdedn.phrdedn_payno = '21'
                  then phrdedn.phrdedn_employer_amt end) "ER21R03",
       sum(case when phrdedn.phrdedn_payno = '22'
                  then phrdedn.phrdedn_employee_amt end) "EE22R03",
       sum(case when phrdedn.phrdedn_payno = '22'
                  then phrdedn.phrdedn_employer_amt end) "ER22R03",
       sum(phrdedn.phrdedn_employee_amt) EENOVR03,
       sum(phrdedn.phrdedn_employer_amt) ERNOVR03
from payroll.phrdedn phrdedn, saturn.spriden spriden
where spriden.spriden_pidm = phrdedn.phrdedn_pidm
  and phrdedn.phrdedn_year = '2011'
  and phrdedn.phrdedn_payno IN ('21', '22')
  and phrdedn.phrdedn_bdca_code = 'R03'
group by spriden.spriden_last_name, spriden.spriden_first_name,
         spriden.spriden_mi, spriden.spriden_id, phrdedn.phrdedn_year

John

Tags: Database

Similar Questions

  • Assignment of values to text to use in the calculation

    Hi, I have extremely limited experience script and am quite stuck trying to get something to work. Any help would be appreciated.

    I have a combo box (ComboBox1) with three other areas of text with three different Option A and Option B Options (or Option C) with numbers in them (NoBox1, NoBox2, NoBox3), I want to use to add up to a total figure.

    Yes ComboBox1 + NoBox1 + NoBox2 + NoBox3 = Total

    I want to assign a numerical value to the text options in the combo box so that I can use in the calculation. Let's say Option A = 8, B = 12 & Option Option C = 16

    Thank you

    Each combo box item can have an assigned value export, so just set it to the number, you want to use for each item. The value of exports of the selected item will become the value of the field to the drop-down list box.

    If more than one element is to use the same export value, it is best to use a different approach, so report it again if this is the case and I'll give you more information.

  • Get the field to remain Virgin until the user enters the value in the previous field used in the calculation

    I work on a PDF form and am stuck on one of my calculations. There are two fields 'desired Start Date", which is a date entered by the user. The "desired end" date is one year from date entered by the user. I figured out - however, before the user enters a date, I want this field remains empty. Currently, it fills with 01/00/000. How can I get this field to calculate not unless a date is entered by the user? So far, I tried this but can not get the blank to stay:

    If the field 'Desired Start Date' is empty, leave 'to' field blank

    var myStartDate = new Date (this.getField("Desired_Effective_Date").value);

    If (((myStartDate == 0) & & (getField("myStartDate").valueAsString = "")) {event.value = "";})

    If the field "Desired Start Date" is an effective date, use the date to calculate one year after the date of entry.

    }

    else {this.getField("to").value = util.printd ("mm/dd/yyyy", new Date (myStartDate.getFullYear () + 1, myStartDate.getMonth (), myStartDate.getDate ()))}

    Try the following than the calculation script custom field "to".

    Get the value of the date field beginning

    var sStartDate = getField("Desired_Effective_Date").valueAsString;

    If the start date field is not empty...

    If {(sStartDate)

    Converts a date in a date object string

    Kai = util.scand ("mm/dd/yyyy", sStartDate);

    Add a year

    oDate.setFullYear (oDate.getFullYear () + 1);

    Set this field to the calculated date value

    Event.Value = util.printd ("mm/dd/yyyy", anyway);

    } else {}

    This field blank because the input field is empty

    Event.Value = "";

    }

    You may need to change the date format "mm/dd/yyyy", I used to match the formats of date fields.

  • Getting values null to use in the calculation of data

    Hey guys, I'm trying to "capture" a zero reading before starting the measurement of my data. I have 4 analog channels that are run continuously thanks to a producer/consumer architecture. I want to press the button 'Start', and hold the most recent value for these 4 channels to calculate certain conditions later in my code. Is there a way to do this without the help of local variables?

    Hi glskinner,

    When you are unsure about the use of the shift register, you should take online courses available on NI.com.

    See this:

  • request to retrieve the value of the column and use in the other rows of the table

    Hi all

    I have a table where I maintain pairs name / value of a particular job.  Now, I would like to see some of the values of the rows passed to other rows in a table for example

    create job_name_value

    (

    VARCHAR2 (100) job_name,.

    name varchar2 (100),

    value varchar2 (100)

    );

    job_name name value
    TRGJOB% FPATH/ USR/LOCAL/TRGJOB
    TRGJOB% FDATECALDATE + 1
    TRGJOB$FNAME1%%FPATH.mywatchfile1.%FDATE
    TRGJOBFNAME2%%FPATH.mywathcfile2.%FDATE
    TRGJOB% FNAME3%FPATH.mywatchfile3.%FDATE

    can we write a sql query to produce output as below the objective is to use the value of fdate and fpath in the remaining lines. If there is no fdate and fpath then value should return such what or we need to use the stored procedure to achieve

    / usr/local/trgjob/mywatchfile1. CALDATE + 1

    / usr/local/trgjob/mywatchfile2. CALDATE + 1

    / usr/local/trgjob/mywatchfile3. CALDATE + 1

    Hello

    Since it cannot be '% FDATTE' or '% FPATH' (or both) then you need to replace each of them separately.  If the other does not, there 'replacement' will do nothing, but this will not affect the result of the other.

    Here's a way to do it:

    SELECT REPLACE (REPLACE (n.value

    '% FPATH.'

    p.value | '/'

    )

    , '% FDATE '.

    d.value

    ) AS output_value

    OF job_name_value n

    LEFT OUTER JOIN job_name_value p ON p.name = '% f '.

    LEFT OUTER JOIN job_name_value d ON p.name = '% FDATE '.

    WHERE n.name AS '\%FNAME%' ESCAPE ' \'

    ;

    I hope that answers your question.

    If this isn't the case, please post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and also publish outcomes from these data.

    Report when the above query is to give erroneous results and explain, using specific examples, how to get the correct results of data provided in these places.  If you change the query at all, your postal code.

    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: https://forums.oracle.com/message/9362002#9362002

  • Include a column not used in the Join Tables

    Hi all
    I need a temporary xy column in the select list not the tables I used for Assembly.

    As SELECT a.abc, b, def
    Of arety one
    Left outer join
    bgtyu b
    on a.id = b.id

    I need an additional column as xy not used from any table


    SELECT a.abc, b.def, xy
    Of arety one
    Left outer join
    bgtyu b
    on a.id = b.id

    Hello

    Try,

    SELECT a.abc,b.def, 'xy' TEMP_COL
    FROM arety a
    Left outer join
    bgtyu b
    on a.id=b.id
    

    In any case, what is the use of this? Can you explain your real need?

    I hope this helps.

    Kind regards

    Manu.

    Published by: Manu. on March 28, 2012 07:07

  • Error @XREF during its use in the calculation

    I have an XREF that retrieves data correctly (I have values for the corresponding members). The data are only XREF would be if the scenario is real, budget data are entered directly.

    However, in the outer cube dimension 'Months' is not the time dimension (the Invoice Date is) in the cube that contains the dimension of the month XREF is the time dimension.

    If I use a business rule that says fiscal value for next year, Jan = actual value of last year, Jan X Variable, then the "real value of last year, Jan' uses the function of XREF (since it queue off the coast of real-world scenario).

    This is when I receive an Error members (1024012) A-T-J and Jan are not in the same dimension in external reference call.

    I changed the XREF of Calc dynamic to the store so when you run a calc all that it store the values and no external reference would be necessary when using the BR, but then I get the error during the calc all.

    I am not consciously referencing Y-T-D at a point (I specifically reference Jan, for example). If I use the Excel plugin, Essbase and Jan of reference I get the correct value.

    Why the Y-T-D error in calculations using the XREF and what can that I do to remedy short making the size of the month in the external database, the dimension of time?

    Do you have time series dynamics?

    Try to remove it and try again...

    See you soon
    RS

  • make changes to a file, I don't create and now used to the function key

    I had to change the dimensions of the file so I am not changing the button actions.  So, it worked before, and now im in CC host trying to get it to work again.  Any ideas how to check where the url I need to go to url google.org

    Here's the AS3

    to import flash.external.ExternalInterface;

    // =========================== CLICKTAG STUFF ==================================

    // =============================================================================

    ct.addEventListener (MouseEvent.CLICK, handleClick);

    ct.addEventListener (MouseEvent.ROLL_OVER, handleMouseOver);

    ct.addEventListener (MouseEvent.ROLL_OUT, handleMouseOut);

    function handleClick(e:MouseEvent):void {}

    ExternalInterface.call("saveglobalscore",score) ("ctaClick");

    trace ("clicked... clicktag");

    / * var flashVars:Object = LoaderInfo (this.root.loaderInfo) .parameters;

    If {(flashVars.clickTag)

    navigateToURL (new URLRequest (flashVars.clickTag), "_blank");

    }

    trace ("clicked"); * /

    }

    function handleMouseOver(e:MouseEvent):void {}

    cta.cta.gotoAndPlay ("OVER");

    cta.gotoAndPlay ("over");

    }

    function handleMouseOut(e:MouseEvent):void {}

    cta.gotoAndPlay ("out");

    }

    do not change the fla.

    Use the original html code and change the object tag:

    width = "550" height = "400" id = 'test' style = "float: none;" ' vertical-align: middle ">

  • I'm figuring (add) a column on a PDF form and on the calculation tab, it doesn't let me select (check) the fields I want to calucalate.  It won't let me type in the fields of the box either.

    I'm figuring the shape (add) a column (sum) on a pdf file and on the calculation tab, it won't let me select (check) the fields I want to use in the calculation.  It won't let me type fields in the box either.  I'm doing something wrong?

    the mouse click on the name of the field and press the space key

  • How to disable the warning of validation on the calculation (read-only) field in the table

    Is it possible to add a line in a calculation script (JavaScript) that prevents a dialog box of a calculation field validation?

    Scenario:

    • Working with fields in a table inserted.
    • In each line, I have a couple of fields that the user has entered. These fields have a Validation model has allowed that the user must enter the data correctly.
    • There is a calculated field based on the data entered by the users. It is this field that throws a warning dialog box "the value entered for Total_Row1 is not valid. "To ignore the validations for Total_Row1, click on ignore.

    Even if I turn off the Model Validation on fields used for the calculation of the warning dialog box always appears. So, it seems to be isolated in the field of computing.

    The calculation area displays the time and I got it originally set as a Date/time field, but also tried to use a text field (as the calculation should appear as 0:45 for 45 minutes in this area).

    I have a suspicion that the warning appears only because I used an array for formatting fields, as I used similar validation profiles and other calculation fields and see not the message when the fields do not appear inside the table.

    I think of easier workaround would be to disable validation for this particular calculation field, but I have no idea how the script that. Any help appreciated lot.

    CARI

    I discovered the problem.  In a word: it was a mistake by naming the fields.

    • I have fields named with line numbers in the field name (for example FieldName_Row1).
    • and fields calls with FieldName_Row1.formattedVallue must have triggered some confusion.

    As soon as I removed the word 'Row' of file names, the question of the warning dialog validation mystery Adobe Acrobat for the calculation field have disappeared.

    Ago about 3-4 hours of my life that I won't be back... ha - ha but if someone else has the problem, I thought I better share my discoveries

  • You will have to jump the calculated fields in a form rather than to stop them.

    I created a nice shape with the calculations of totals and subtotals.  However, when you complete the form, Adobe stops to calculated fields as if I had to do an entry in each. I want to jump over the calculated fields.  Is this possible?

    Set them read-only.

  • Who join use in the situation below?

    Hello
    I have 2 tables with structures like below

    Table:-Machine
    (machinename char (5),
    MachineId char (6),
    date StartTime,
    end date,
    quantity)

    Table:-stop

    MachineId char (6),
    date of shutdowntime,
    shutdownmins char (5)

    What I want to do, is change machine starting and endtimes table according to the table to stop stops.

    Basically I will be leading table having structures like the machine table with just the difference in time of start and end according to the cases.
    Means that I will have a query select selection of fields that from the machine table table stop but will only be used for the calculations of time change.

    I am little confused here what join to use or have any other way to solve this problem.
    I need select only query response.

    Experts help me!

    Thank you
    Mahesh

    >
    So basically I will not need to select any since the closure just for the calculation
    >
    Well, which makes no sense.
    The only way that you can use "shutdown" calculation is to choose in this one.

    That's what Salomon showing you; How to select the data that you need it and do the math.

  • How to create a script for the calculation of the VO2max using text on a pdf form field values.

    I'm trying to create a script that calculates the VO2max based on user input in several text fields.

    My form is set up so that the user can enter values in the 4 fields of text:

    1 weight = weight in kilograms

    2. age = age in years

    3 time = time to walk 1 mile in decimal

    4. the heart rate (HR) = heart rate recovery immediately after you have finished walking 1 mile

    The VO2max equation that I use is:

    VO2max = 132.853 - (0.1692 * weight)-(0.3877 * Age) + (6,315) - (3.2649 * time)-(0.1565 * HR)

    After the user enters values in 4 text fields, I want the text of VO2max field automatically calculate the above equation and display the result to the user so that the user doesn't have to get all those numbers into a calculator.

    Any suggestions on how to write the script?

    Assuming that your domain names are what you entered in the formula, you can use the simplified field notation:

    132.853 - (0.1692 * weight)-(0.3877 * Age) + (6,315) - (3.2649 * time)-(0.1565 * HR)

    If you want the value to display only after al the data fields are complete you need to use a JavaScript calculation:

    function GetField (cName) {}
    oField var = this.getField (cName);
    if(oField == null) app.alert ("field of error for access to the" cName + "\nPlease verify the name of the field.", 1, 0 ");
    return oField;
    }

    var weight = GetField ("Weight");
    var Age is GetField ("Age");.
    var time = GetField ("Time");
    var h = GetField ("HR");

    Event.Value = "";
    If (Weight.value! = 0 & Age.value! = 0 & Time.value! = 0 & HR.value! = 0) {}
    Event.Value = 132.853 - (0.1692 * Weight.value)-(0.3877 * Age.value) + (6,315) - (3.2649 * Time.value)-(0.1565 * HR.value);
    }

  • The use of div to create columns

    Hello

    I created (or attempt) to create a page with three colum with the div tag It seems OK except when I add content (or delete) to the div in right and left it mesess upward.

    Here is the link to the page

    http://www.dealfindit.com/productadpc.php?ProductID=211959635

    As soon as there is no content in the right Division moves the Center div. What is the best way to create a correct page of three columns with div I can't use the table that I use for the content div. Center repeat region

    Here is the code:

    css code
    =========
    
    #headlines{
     float: left;
     width: 15%;
     border-right: 1px solid #cccccc;
     border-bottom: 1px solid #cccccc;
    }
    #headlines2{
     float: right;
     width: 15%;
     
     border-left: 1px solid #cccccc;
     border-bottom: 1px solid #cccccc;
    }
    #headlines{
     margin: 0px;
     padding: 2px 0px 2px 2px;
     /*font-size: 80%;*/
    }
    
    #headlines2{
     margin: 0px;
     padding: 2px 2px 2px 0px;
     /*font-size: 80%;*/
    }
    
    
    
    

    First and foremost -.

    Styles of club with the same ID together as follows:

    #headlines{ float: left; width: 15%; border-right: 1px solid #cccccc; border-bottom: 1px solid #cccccc; margin: 0px; padding: 2px 0px 2px 2px; /*font-size: 80%;*/
    
    }#headlines2{ float: right; width: 15%;  border-left: 1px solid #cccccc; border-bottom: 1px solid #cccccc; margin: 0px; padding: 2px 2px 2px 0px; /*font-size: 80%;*/
    
    }
    

    then add a style for your average main content div too... something like:

    #mainContent {}
    Width: 68%;
    margin-left: 16%;
    margin-right: 16%;
    }

    Since each div left and right is 15%, I added 1% on either side to give some space (16%) and the width of 68% mainContent DIV (with additional 1% margins and padding already defined and all you may need to cut a little more... say 67 or 66%).

    and in html, you can have:

    Left content side comes here

    main central section comes here

    So, even if it stretches not no content in the left and right divs, the central section and should in place.

    Kind regards

    Vinay

  • Hi, I recently bought numbers in order to create a commercial newspaper. I'm the pen and paper. I need help to create a formula. A purchase column determines if the entry price column is subtracted from the price of output column or output subtracted

    Hi, I recently bought numbers in order to create a commercial newspaper. I'm the pen and paper. I need help to create a formula. A purchase column; Determines if the entry price column is subtracted from the price of output column (buy) or subtracted from (Sell) entry exit. Thank you for your help

    Hi B',.

    Buying and selling in column B

    Price of entry in column c.

    Exit in column D price

    Formula (and outcome) in column E

    If the column will B always contained 'Buy' or 'Sell', it works. It is default to a calculation of 'sell' if sale or has been specified.

    E2: = IF (B = "Buy", D - C, C - D)

    If you want to delay the calculation until the amounts entered in C and D, use this version:

    E2: = IF (OR (LEN (C) < 1, LEN (D) < 1,"", IF (B = "Buy", D - C, C - D) ")

    If you want to delay the calculation until all three ducks are on a line (B contains buy or sell, C and D contain both data), use this version:

    E2: = IF (OR (LEN (C) < 1, LEN (D) < 1,"", IF (B = "Buy", D - C, IF(B="Sell",C-D,) "" ")))

    Third version used in this table.

    Kind regards

    Barry

Maybe you are looking for

  • Sierra on iMac sleep restart OS

    Select the day before leaving the iMac, or when sleep occurs when the value in energy saving; Sierra of OS - macOS 10.12 (A 16, 323), Darwin 16.0.0, system restarts on hitting escape to wake up.

  • Ranging from network WiFi problem

    My current installation (works perfectly!) is: -Airport Extreme (connected to a MacMini Server OSX) v Airport Express (WiFi connection to the EPA as an extension of network) Various devices are connected, air-conditioned and equipped with DHCP (Mac c

  • Attempt to update 21.0 loops connecting"for updating the server." How should I do?

    «I'm in Firefox 20.0.1 on a 660 s Dell Windows 7 Home Premium.» I downloaded and installed Firefox in May. I can't take it to 21,0 for the following reason: "Update available" window for Firefox 21.0 opens every day. I click on update Firefox and "Do

  • belonging

    Hello.. Send an smtp message, I used and I get ERROR-TCP connection open in NI_SMTPEmail.lvlibPSG Email open Session.vi:3-> NI_SMTPEmail.lvlibPSG send E-mail Charset.vi:2-> NI_SMTPEmail.lvlibPSG Email send message:1-> send_email.vi. Please tell me th

  • Aero does not work - troubleshooting is not help

    Aero does not work. I ran the resolution of problems and she came back as: Color depth is set too low - not not fixed Desktop Window Manager is disabled - detected He was not able to solve the problems itself. Here are the details he gave me: Problem