Displaying the values from a single column into two columns???

hi buddies.....I've a table "Stock" and its fields are:
Date, Invoice#, prod_id, sal_qty, pur_qty, rate, status
The "rate" column stores the rate value on which a product was sold or purchased and "status" column values are like "S" for Sale,"OP" for opening and "P" for purchase.
The problem here to me is that I'm unable to pick the purchase & sale rate of a product based on the status either "S" or "P". Is it possible to pick the purchase rate of a product sold between a specified limit of dates??? and show both sale & purchase rates in two separate columns in the result sets for a given product in a specified duration. The resulte set format should be like this:
Prod_id Sale_Rate Pur_Rate

Dear Dmitri,
Let me tell u my case more elaborately so that u can have a better insight on my problem. I've a Stock table to which I'm trying to use to calculate current stock quantity, its value and profit per sale transaction. It has following simple description.
Stock_Table:
Invoice#     Date     Product     Batch# Sale_QTY     Pur_QTY     Rate Status
Pur-001     01/01/05     Asprin          AB123      0     100           10 OP --(Opening)
Pur-002 02/01/05     Paracetamol CD456          0     150          15 OP
Pur-002 03/01/05     Menthol XY333           0     80          7     OP
Pur-003     01/01/05     Asprin          ZZ990           0     50          8     P ..(Purchase)
Sale001 02/01/05     Asprin          AB123           10     0          2     S
Sale001 02/01/05     Paracetamol      CD456           5     0          16     S ..(Sale)
Sale002 04/01/05     Asprin          ZZ990           6     0          10     S
Sale002 04/01/05     Paracetamol      CD456           7     0          20     S
Sale002 04/01/05     Menthol      XY333          4     0          10     S
From this design can u calulate the difference of sale & purchase rate of a product during a range of dates(which is the Profit)? i.e firstly pick a sale transaction and then minus the purchase rate of the product from the sale rate in that sale transaction by looking at the product name and its batch number.
While solving this case, please keep in mind that I'm using Oracle 8.0 which doesn't support inlined Sub-Query(a query within FROM clause). So giving u a hint(although I'm not genious enough;), I tried the Self Join at Stock Table by picking the sale rows at first and then purchase rows afterwords by giving this table two different names. I also tried the following query by joining the Sale Table with Stock Table. Is it the right way I'm heading towards???
SELECT S.Sale_Date, SD.Invoice#, SD.Product, SD.QTY, SD.Rate Sale_Rate,
ST.Rate Pur_Rate, ST.Product
FROM Invoice_Master S, Invoice_Detail SD, Stock ST
WHERE S.Invoice# = SD.Invoice#
AND ST.Status IN('OP','P')
AND ST.Product = SD.Product
AND S.Sale_Date BETWEEN :From_Date AND :To_Date
AND SD.Product = P.Product
ORDER BY S.Sale_Date

Similar Messages

  • Displaying the ResultSet from and sql database into a java Table in the sam

    i seriously need help in displaying the contents of my sql database into a table im my java application when someone types a query into a field provided..
    thanks guys !!

    What kind of help do you need.
    Are you stuck at some point of your code?
    Is you code not working?
    Or do you want us to write the code?

  • How to display the values from the table in the screen

    Hi,
    I have created a screen where i will enter the values for the field treshold amount and desc and if i press update button  .it will update the new values by overriting the existing values .
    Now i have got requirement i need to create a button show which will display the existing value from the table. always there will be only one entry...in this table
    Please can one give me idea...to do this
    or sample code...thanks in advance
    regards
    paveeeeee

    Define a function code 'SHOW' for your button. In your PAI module, when you check for various sy-ucomms, check for 'SHOW' also.
    Your code will be like this:
    Case sy-ucomm.
      when 'SHOW'.
         perform show_details.
    endcase.
    In the perform, you can fetch the data from the table and put it in global variables. In the PBO, move the data from the global variables to the screen fields so that they get displayed on the screen.
    Hope this helps. Reward points for useful answers.
    Regards
    Nithya

  • Splitting one column into two columns

    Hi,
    How to create two columns in one column header using JTable swing concept in java.
    Thanks in advance

    [http://forum.java.sun.com/thread.jspa?threadID=488822&messageID=2297054]
    you can use MultiLineHeaderRenderer class for this purpose. search for that class and examples
    sunil

  • Can I export values from an excel spreadsheet into a dropdown field in Acrobat?

    I'm creating a form in Acrobat with a dropdown field as an option, I would like to know if I could export the values from an Excel spreadsheet into this field (there are 600 records)?

    Sorry this is not something that we currently support. You have to enter your items manually. Once you created you field though you can copy in paste to other forms so you only have to create it once.

  • How to get the value from a database without submitting a jsp page

    I have a jsp which has a text box depending on the value entered I want to get the value from a database for other two fields with out submitting jsp page. I am using struts.
    Thanks For any assistance provided.

    Alright,here is an example for you for the first case.
    Present.jsp:
    ============
    <html:html>
    <head>
    <title><html:message key="page.title"/></title>
    </head>
    <body>
    <html:form action="ChangeEvent.do">
    <html:hidden property="method"/>
    <!-- Submitting the Form onKeyUp of EmpId field and trying to save the
         state of the Form in the scope of session -->
    Emp Id:<html:text property="empId" size="5"  onkeyup="if(true){this.form.elements[0].value='populateDetails';this.form.submit();}"/>
    Emp Name:<html:text property="empName" size="10" />
    Email Address:<html:text property="email" size="10" />
    <html:submit>Submit</html:submit>
    </html:form>
    </body>
    </html:html>struts-config.xml:
    ==================
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
    <struts-config>
    <!-- Form bean which stores the properties of all the Form elements -->
    <form-beans>
    <form-bean name="employeeFormBean" type="org.apache.struts.action.DynaActionForm">
       <form-property name="empId" type="java.lang.String"/>
       <form-property name="empName" type="java.lang.String"/>
       <form-property name="email" type="java.lang.String" />   
    </form-bean>
    </form-bean>
    <action-mappings>
    <action path="/ChangeEvent" type="Test.GetChangeAction" name="employeeFormBean" scope="request" parameter="method"> 
    <!-- On successful call of DB the Page has to be forwarded to the same page again by
          uploading updated form bean values. -->
    <forward name="success" path="/Present.jsp"></forward>
    <forward name="failed" path="/error.jsp"></forward>
    </action>
    </action-mappings>
    </struts-config>GetChangeAction.java:
    =====================
    public class GetChangeAction extends DispatchAction{
      public ActionForward populateDetails(ActionMapping mapping,ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
            DynaActionForm dForm = (DynaActionForm)form;
            String empId = dForm.get("empId");     
            // calling Model / Db and then getting back Employee Details
            EmployeeBean eb = ModelUtils.getDetails(empId);
            // Updating form bean by updating values from the Model 
            dForm.set("empName".eb.getEmpName()); 
            dForm.set("email".eb.getEmail());
            return mapping.findForward("success");
    }well to me this should work regardless to any browser but we need to make sure we put in our logic properly.

  • Display last value from a row or column?

    I'm using Numbers 09 and want to display the last value entered in a column in another table.
    For example in Table A I have columns set up by date with simple sums at the bottom of each column. I add new sums every day depending on the values from that day. What I'd like to do is get the last daily total and enter that value into another table called Table B. Is there a formula that will do that?
    If I'm not being clear enough please let me know what additional information you need and I will be happy to provide it.
    Thanks,
    rkaufmann87

    rkaufmann87 wrote:
    Hi Barry,
    Thanks for posting the example, not quite though. In your sample Table A is transferring all the totals to Table B. What I'd like is as I enter the data in the columns in Table A Table B then picks up the latest update in a single cell. For example lets say Table A's Column A is May 1 and the total is 45, let's say that sum is placed in A15. Table B automatically picks up A15 from Table A and makes a duplicate in Table B cell A1, then the next day Table A's Column B is May 2 and the total is 90 (cell B15), then Table B senses the latest total is 90 and enters that in cell A1 again. Is this possible?
    Here's another go.
    Table 1 has a second Header row added (row 2) Cells in this row contain the formula
    =IF(A1=MAX($1:1),COLUMN(),"")
    Which returns the column number of the cell in row 1 containing the latest date. (4) This number is used by Table 2 to determine the column from which to return the total in the bottom (footer) row. (see below)
    A1 in Table 2 and Table 3 contain the same formula:
    =MAX(Table 1 :: $1:1)
    This returns the latest date from row 1 of Table 1.
    A2 in Table 2 and Table 3 contain formulas that return the value in the bottom cell of the column containing the latest date in row 1.
    Table 2:   =OFFSET(Table 1 :: $A$1,ROWS('May 1, 2010')-1,MAX(Table 1 :: $2:2)-1)
    Table 3:   =OFFSET(Table 1 :: $A$1,ROWS('May 1, 2010')-1,COUNT(Table 1 :: $1:1)-1)
    Both use the same base ($A$1) and the same row offset (ROWS('May 1, 2010')-1) to reach the bottom row of Table 1.
    Table 2 uses the maximum (and only) numerical value in row 2 of Table 1 ( MAX(Table 1 :: $2:2) ), then subtracts 1 to reach the fourth column of table 1.
    Table 3 uses the same means to determine the row offset, but counts the number of dates entered into row 1 of Table 1 ( COUNT(Table 1 :: $1:1) ), then subtracts 1 to reach the same cell.
    I prefer the method in Table 3 because it avoids the need for the second Header row and the possibility of overwriting the formulas in that row. (Row 2 of Table 1 may be deleted without affecting Table 3.) It does require that there be no empty cells in Row 1 from Column A to the column containing the latest date.
    Regards,
    Barry

  • How to add a column to a list created with the Dynamic List Wizard to display the values of the fiel

    Hi,
    ADDT, Vista, WAMP5.0
    We have 2 tables: clients_cli (id_cli, name_cli, tel_cli, and several more fields) and cases_cas (id_cas, idcli_cas, court_cas, and a lot of other fields).
    Clients may have many cases, so table cases_cas have a foreign key named idcli_cas, just to determine which case belongs to which client.
    We designed the lists of the two tables with the Dynamic List Wizard and the corresponding forms with Dynamic Form Wizard.
    These two forms are linked with the Convert Dynamic List and Form Wizards, which added a button to clients list named "add case".
    We add a client and then the system returns to the clients list displaying all clients, we look for the new client just added and then press "add case", which opens the Dynamic Form for cases, enter all case details and everything processes ok.
    However, when we view the cases list it display all the details of the case, including the column and values for the foreign key idcli_cas. As you can image, it is quite difficult for a human to remember the clients ids.
    So, in the cases list we added a another column, named it Name, to display the names of the clients along with cases details. We also created another recordset rsCli, selected the clients_cli table, displaying all columns, set filter id_cli = Form Variable = idcli_cas then press the Test button and everything displays perfect. Press ok.
    Then, we position the cursor inside the corresponding cell of the new Name column, go to Bindings, click on name_cli and then click on insert. The dynamic field is inserted into the table cell as expected, Save the page, and test in browser.
    The browser call the cases list but fails to display the values of the Name column. The Name column is simply empty.
    This issue creates a huge problem that makes our application too difficult to use.
    What are we doing wrong?
    Please help.
    Charles

    1.     Start transaction PM01, Create Infotype, by entering the transaction code.
    You access the Create Infotype screen.
    2.     Choose List Screen.
    3.     In the Infotype no. field, enter the four-digit number of the infotype you want to create.
    When you specify the infotype number, please remember to enter any leading zeros.
    4.     In the Screen Number field, enter the screen number of the list screen you want to enhance.
    5.     Choose Create.
    The Dictionary: Initial screen appears:
    6.     Create the list screen structure.
    7.     Choose Activate.
    8.     Return to the Enhance List Screen in the Enhance Infotypes transaction (PM01).
    9.     Choose Create All.
    The additional fields are displayed on the list screen, however, they contain no data.
    The fields can be filled in the FORM routine FILL-LISTSTRUCT in the generated program ZPnnnn00. The FORM routine is called for each data record in the list.
    Structure ZPLIS is identified when it is generated with a TABLES statement in the program ZPnnnn00.
    The fields can be filled from the Pnnnn structure or by reading text tables.

  • Moving the data from multiple internal tables into a single one

    Hello everyone,
    I am creating a classical report which uses the following tables.
    tables : ekko, ekpo, mara, makt,lfa1.
    my input parameter is 
    Select-options Purchase Order number
    Following fields are getting used.
    Doc no                  EKKO-EBELN
    Material              EKPO-MATNR
    Item number          EKPO-EBELP
    Quantity             EKPO-MENGE
    Material Group          MARA-MATKL
    Vendor                  EKKO-LIFNR
    Old Material code   MARA-BISMT
    Material Desc.           MAKT-MAKTX
    Vendor name         LFA1-NAME1
    Now i need to do the following task.
    1 Select record from EKKO Using document number.
    2 Select record from EKPO using EKKO record using Document no as key.
    3 Find out Old Material code of each and every material from Material master.
    4 Find out Material description for each and every material from MAKT.
    5 Sort record on Vendor, Purchase Order number and Material.
    I have defined seperate internal tables for these operation.
    Once i have fetched records into these individual internal tables  from the corresponding DB tables i need to move these values into a new internal tables which has all the above fields mentioned
    I need to move these values into a new internal table because to display the values on the report.
    Any idea for the above ? Plz help with a sample example or some relevant.
    Regards,
    Ranjith Nambiar

    Hi
    1 Select record from EKKO Using document number.
    2 Select record from EKPO using EKKO record using Document no as key.
    Use inner join and retrive data into one internal table.for Ex ITAB1
    3 Find out Old Material code of each and every material from Material master.
    Use ITAB1 with for allentries in MARA table to get the onl materil number populate in to one table.
    4 Find out Material description for each and every material from MAKT.
    Get the Material desc with the same manner as above,
    5 Sort record on Vendor, Purchase Order number and Material.
    now sort the ITAB1 as you req.
    now Loop on the ITAB1.
    and read above 2 tables for old matnr and matner deac and append into another table as you want.
    Hope this will help.
    Regards,
    Hiren Patel

  • How to display the value of a column in a chart at the top of each column

    How to display the value of each column in a chart at the top of each column?

    Like this?
    Done using chart Inspector.
    For details, see Chapter 7,  Creating Charts from Numerical Data in the Numbers '09 User Guide. The guide may be downloaded via the Help menu in Numbers.
    Regards,
    Barry

  • Call  RFC from ECC and display the values in  AET

    Hi ALL,
    I had an RFC in ECC ( Z_CRM_SPEC_DATA) this should be called into my AET Fields in getter method.
    In getter method of tat AET field what code should i write?
    Plz help me on this.

    HI,
    1) Call the  RFC(Z_CRM_SPEC_DATA) from ECC and display the values as mentioned in below AET fields.
    AET FIELDS :    zzfld00000M    zzfld00000N
    Description  :    Budget Quan    Forecast Quan
    values         :    (--5.0)(6.0--
    2) (Fetch Budget and Forecast data from ECC ),you would need to pass Material Number(MATNR) as well as Ship to party info to fetch the budget and forecast data as one material may be assigned to 2 or more SH with specific budget and forecast data for each.
    Edited by: venkatabharathv on May 23, 2011 2:44 PM
    Edited by: venkatabharathv on May 23, 2011 2:49 PM

  • Poplist and displaying corresponding values from the database table

    Hi
    I have a poplist in a control block, the values of which are populated using a procedure. This is called in when-new-form-instance.
    This part works fine and values are filled in the poplist when form is opened..
    The datablock is based on a view. 3 columns from the view are selected to be displayed.
    Also the databock is filled with all values (for selected columns)
    Now when the poplist value is changed, I need the values in the datablock to be changed as well, but this is not happening.
    In my when-list-changed trigger, I have:
    go_block('datablock');
    execute_query;Please tell , where and what should I add to display the datablock values as per the poplist value.
    i.e, something like,
    select col1,col2,col3 from <view> where col4 =:control.col4
    Note:I tried in the where clause property of the block, but then nothing is displayed in the datablock
    Thanks

    This does not work , either..
    Before, when I changed the values from the list, it was still displaying same data on datablock always(all records)
    Now when I give this code,data is displayed in datablock only once(first time when the form opens)
    I have defined the Query data source type property on data block as "Table" but infact this datablock is based on a view..is this correct?
    Anything else I could try?

  • From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    Hi,
    Use NVL or COALESCE:
    NVL (col_a, col_b)
    Returns col_a if col_a is not NULL; otherwise, it returns col_b.
    Col_a and col_b must have similar (if not identical) datatypes; for example, if col_a is a DATE, then col_b can be another DATE or it can be a TIMESTAMP, but it can't be a VARCHAR2.
    For more about NVL and COALESCE, see the SQL Language manual: http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions119.htm#sthref1310
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • Htmlb:get the values from bean n display it in textView

    Hi,
    I am doing one PDK application using jspdyn page. In jsp page I am using htmlb to display the table. In that I am using one text view element. There I need to get the values from bean class.And display it in a table.
    Can anyone help me how can use the textView inside htmlb to retrieve the values from bean.
    Thanks & Regards
    Vineela

    hi vineela,
    For the textView, in the text value write the code  <%=myBean.getStr()%>
    where myBean will be your bean class and getStr() is the method in the bean class whcih returns value which needs to be displayed on the screen.
    Thanks
    Harsimran

  • Copy the value from one item into another

    Hi,
    I have a page with 2 items on it: Field1 and Field2. When the user enters a value in Field1 and tabs out, I want to copy the value to Field2.
    I have changed the setField1 method in the VORowImpl to call setField2 passing in the same value.
    In the JHeadstart definition file I have set the Depends On Item property of Field2 to be Field1.
    When I run the page and put a value in Field1 the page autosubmits as expected and the setField1 method runs. Unfortunately, the value does not appear in Field2.
    Any ideas?
    Thanks,
    Gavin

    Hi Steven,
    Checking the box does indeed get the value from Field1 into Field2.
    What I want to do, though, is to populate Field2 from Field1 only if Field2 is empty. Unfortunately, Field2 is now cleared before the setter of Field1 executes and so it always overwrites Field2.
    Any ideas?
    Thanks,
    Gavin

Maybe you are looking for

  • Why do the latest versions of Indesign and Photoshop not work on my computer?

    I own a Toshiba Satellite L675 and when I was using photoshop cs5 extended it worked fine. However I recently purchased Photoshop cs6 extended and after trying to install it i recieved an error:213:10. After that i tried downloading Indesign CS6 to s

  • MP3 Car Input not working with Iphone

    When I plug my Iphone into my car's mp3 Aux input using my current mini plug connector (which works fine with my Ipod)) the music continues to play out of the iphone and not through my cars' stereo. The car is set correctly as the ipod works fine. Am

  • How to switch Planning to new Oracle schema?

    We are on Planning 9.3.1 and we created a new Planning application on our Disaster Recovery Server. However, we created it to use the wrong data source. We then used Data Source configuration utility to create a new data source pointing to a new Orac

  • Initialization Blocks and Variables in 11G

    I'm trying to set up an Initialization Block and Variable so my dashboard data can be filtered by User. I did the following, but all the data is still being shown (instead of the data being filtered). - In my Repository I went to Manage - Variables -

  • Tilda Acting goofy

    I installed tilda in order to have terminal transparent on my desktop. However it doesnt work properly.. If I type a character, its displayed.. but if I type another character, the first one that was there disappears and it only displays the second o