Write a query for which has its field name as input parameter

Hi All,
I need to write a query for SSRS report. StartDate, EndDate and ChangedField are the input parameters.
Let's consider that we are taking employee details. The table contains lot of fields like emp name,add1,add2,city,state,country,designation,rank etc. We have almost 30 fields are there. These field name are coming as input parameter "ChangedField"
. I need to show the records which belong to the start date and end date also data change for the field which is given in the input parameter "ChangedField".  That meand If I give ChangedField="city", we need to check for data which
has been updated with new City name in the given time period.
Please suggest.
Regards,
Julie

Hi Julie,
Per my understanding that you have many fields in the table to be displayed in the report, some of the fields will always show and others should be hide and show based on the selection of the parameters which include the columns names, right?
By default, we can't display columns dynamically in the report automatically without insert this column in the report before. So, in your scenario, I will suggest you to add all the columns in the reports first and then add show/hide expression on
the column visibility based on the selection of the parameter "ChangedField", when some of the fields selectted they will be display, otherwise they will be hidden. For the fields which you want to be always displayed will not need to add the expression
in the column visibility.
Details steps about how to acheive this, please referencet to the  article below:
Displaying Dynamic Columns in SSRS Report
If you still have any problem, please feel free to ask.
Regards,
Vicky Liu
Vicky Liu
TechNet Community Support

Similar Messages

  • How to call a dll which has one VISA name as input

    Hi there,
    The Labview application builder can generate a dll file from a vi which is a simple serial comunication program using VISA name as one control.
    The problem is how to call the dll file in Labview which has a VISA name as INPUT?
    Thanks!
    George

    I would suggest modifying the LabVIEW VI so that the input is a string control instead of a visa control. The LabVIEW application will work the same and there is no need for any casting. All visa VIs can take a string as an input. Then when you recreate the dll make the input a string. Then you can easily pass a string to the dll from any API.
    -Josh

  • How to write sql query for counting pairs from below table??

    Below is my SQL table structure.
    user_id | Name | join_side | left_leg | right_leg | Parent_id
    100001 Tinku Left 100002 100003 0
    100002 Harish Left 100004 100005 100001
    100003 Gorav Right 100006 100007 100001
    100004 Prince Left 100008 NULL 100002
    100005 Ajay Right NULL NULL 100002
    100006 Simran Left NULL NULL 100003
    100007 Raman Right NULL NULL 100003
    100008 Vijay Left NULL NULL 100004
    It is a binary table structure.. Every user has to add two per id under him, one is left_leg and second is right_leg... Parent_id is under which user current user is added.. Hope you will be understand..
    I have to write sql query for counting pairs under id "100001". i know there will be important role of parent_id for counting pairs. * what is pair( suppose if any user contains  both left_leg and right_leg id, then it is called pair.)
    I know there are three pairs under id "100001" :-
    1.  100002 and 100003
    2.  100004 and 100005
    3.  100006 and 100007
        100008 will not be counted as pair because it does not have right leg..
     But i dont know how to write sql query for this... Any help will be appreciated... This is my college project... And tommorow is the last date of submission.... Hope anyone will help me...
    Suppose i have to count pair for id '100002'. Then there is only one pair under id '100002'. i.e 100004 and 100005

    Sounds like this to me
    DECLARE @ID int
    SET @ID = 100001--your passed value
    SELECT left_leg,right_leg
    FROM table
    WHERE (user_id = @ID
    OR parent_id = @ID)
    AND left_leg IS NOT NULL
    AND right_leg IS NOT NULL
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Any Orjinal SAP Reports which has currency field and currency key

    Hi Friends,
    I am looking for a report which has currency field and currency key at selection screen. I want to learn how SAP do selection with currency. Can you say a transaction deal with my desire?
    Thanks.

    try report RFSSLD00
    A.

  • Need to write SQL query for hierarchy

    Hi Guys,
    I need help to write a query for the below scenario.
    I have one organization, under that I have many branches. when i provide input to query on last branch, i need to display all parents of that branch like below
    Organization   ---parent
      branch 1  ---child
         branch11
         branch 12
        branch 2   ---child
          branch 21
         branch 3 ----child
          branch 31
          branch 32
          branch 33
    here, when i provide input as branch 3, then I need to fetch results branch 2, branch 1 till organization.
    can any one help me on this.
    Thanks in advance!
    Regards,
    LKR

    Hi,
    Is this the same question as
    https://community.oracle.com/thread/2616828
    Please don't post the same question over and over.  Mark this thread as "Answered" right away, and continue in the other thread (if necessary; the other thread has answers.)

  • Write a query for finding STDDEV for OLAP Cube

    Can anybody post a sample query which will find the standard deviation of sales for each month in the sample GLOBAL OLAP schema for Oracle 11g.
    The OLAP option automatically generates a set of relational views on cubes, dimensions, and hierarchies in Oracle 11g. So how can i write a query for finding the Standard deviation on these views.

    The easiest way to do this is to do this directly within the AW using a custom calculated measure. In AWM11g you can use the 11g custom measure wrapper to execute the STDDEV function:
    olap_dml_expression('function',data type)
    For example
    olap_dml_expression('STDDEV(cube_name, time_dimension_name)',number)
    You can then simply expose this calculated measure as another column in your SQL View and then there is no need to use the SQL equivalent. This means the calculation is performed inside the AW (which is as close to the source data as you can get) ensuring performance of the whole query remains high.
    If necessary you can take this a step further, if required, and wrap the STDDEV calculation within an OLAP DML program that would allow you to manipulate the status of time within the calculation. For example, you may want the STDDEV calc to only take into account the last 12 time periods rather than all time periods currently in status.
    Hope this helps
    Keith Laker
    Oracle EMEA Consulting
    OLAP Blog: http://oracleOLAP.blogspot.com/
    OLAP Wiki: http://wiki.oracle.com/page/Oracle+OLAP+Option
    DM Blog: http://oracledmt.blogspot.com/
    OWB Blog : http://blogs.oracle.com/warehousebuilder/
    OWB Wiki : http://wiki.oracle.com/page/Oracle+Warehouse+Builder
    DW on OTN : http://www.oracle.com/technology/products/bi/db/11g/index.html

  • Load the data for which these 2 fields are not initial (Blank).

    Hi Experts,
    I am extracting data from R/3 to BW using a Z data source based on view.
    In the extract there will be 2 fields User ID & Date.
    My requirement is to load the data for which these 2 fields are not initial (Blank).
    My Data source is extracting all the data from R/3 to BW.How can filter it out in BW.
    Thanks

    Hi Siegfried,
    Thanks for the info Provided.
    As I am new to BW, Could you please provide me with the code (ABAP) I need to insert and where...in which part of the below start routine in need to insert the code....
    My requirement is to load the data for which the USER ID (ZUSR_ID) & DATE (ZDATE) is not null/blank/0.
    <b>Start Routine IN Transfer Rules</b>
    Global code used by conversion rules
    $$ begin of global - insert your declaration only below this line  -
    TABLES: ...
    DATA:   ...
    $$ end of global - insert your declaration only before this line   -
    FORM STARTROUTINE
      USING    G_S_MINFO TYPE RSSM_S_MINFO
      CHANGING DATAPAK type TAB_TRANSTRU
               G_T_ERRORLOG TYPE rssm_t_errorlog_int
               ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel datapackage
    $$ begin of routine - insert your code only below this line        -
    DATA: l_s_datapak_line type TRANSFER_STRUCTURE,
          l_s_errorlog TYPE rssm_s_errorlog_int.
    abort <> 0 means skip whole data package !!!
      ABORT = 0.
    $$ end of routine - insert your code only before this line         -
    ENDFORM.
    Thanks for the help.

  • Which table stores field names and their description?

    When I go to se11; I can get information about a table; its field names and field description.
    How can I access same information using an ABP Program? I have a third party tool which connects to SAP; it can pull data from any SAP Table or view. I do not know which table or view stores information displayed in SE11.
    Thanks a lot.

    Hi zigzagdna,
    The field names and their description are strored in table DD03L and DD03T.
    SAP DDIC dictionary informations are generally store in DD* tables. You can search this kinds of DD* tables in SE11 using F4 search help.
    With Best Regards
    Julia

  • How to write selection Query for the following requirment.

    Hi All,
    I am new to ABAP, I need a help ,
    I need to select all plants(WERKS) from MARC at Plant/Material level,
    then I need to take all sales organozation(VKORG) from T001w,
    then I need the company code(BUKRS) from TVKO based on VKORG,
    then I need the currency key(WAERS) from T001 based on BUKRS,
    Can any one help me in writing selection Query for the same?
    Thanks All,
    Debrup.

    Hi,
    Its easy for you if you learn SELECT with JOIN to complete your task. So SEARCH the forum with SELECT statement and you will get a lot of examples using which you can write your own.
    If you struck up anywhere revert back.
    Regards
    Karthik D

  • Help to write a query for cursor

    Hi
    I have a table trans_table which has records for all Credit (C) and Debit(D) entries for customers with the trans_date.
    Now there is a column adj_amt which contains 0 for all D entries. But for C entries it contains current trans_amt - Prev trans_amt. If there is no prev record with C type then it is 0. i.e. If this the first C entry for a particular account then adj_amt will contain 0.
    Below is the data.
    create table trans_table (cust_id number, tran_date date, tran_amt number, tran_type char(1), adj_amt number);
    1 01/01/2007 100     D 0
    1 01/01/2007 100     D 0
    1 01/02/2007 80     C 0
    1 05/02/2007 200     C 120
    1 08/02/2007 300     C 100
    2 01/01/2007 100     D 0
    2 05/01/2007 100     D 0
    2 08/01/2007 100     D 0
    2 09/01/2007 100     D 0
    2 01/02/2007 90     C 0
    2 05/02/2007 200     C 110
    3 01/01/2007 100     D 0
    3 05/01/2007 100     D 0
    3 08/01/2007 100     D 0
    4 01/01/2007 100     D 0
    4 05/01/2007 100     D 0
    4 06/01/2007 100     D 0
    4 08/01/2007 100     D 0
    4 10/01/2007 100     D 0
    4 01/02/2007 100     C 0                    
    Now hv to write a query whioch gives the cust_id , max(tran_amt) with D entry, max(trans_amt) wth C entry and if no C entry record then this column will be 0.
    The output wud be klike this..
    1 100 300
    2 100 200
    3 100 0
    4 100 100
    Since cust_id 3 has no C entry so 0 value in 3rd column.
    Now i wrote a query for cust_id and 2nd column, but am not able to get the 3rd column.
    Is it possible to get the above output..
    I wud be using this query in a cursor which wud fetch from 20 million transactions.
    Thanks in advance
    Piks
    (I am pasting the insert script if required)
    insert into TRANS_TABLE (CUST_ID, TRAN_DATE, TRAN_AMT, TRAN_TYPE, ADJ_AMT)
    values (4, to_date('01-02-2007', 'dd-mm-yyyy'), 100, 'C', 0);
    insert into TRANS_TABLE (CUST_ID, TRAN_DATE, TRAN_AMT, TRAN_TYPE, ADJ_AMT)
    values (4, to_date('05-01-2007', 'dd-mm-yyyy'), 100, 'D', 0);
    insert into TRANS_TABLE (CUST_ID, TRAN_DATE, TRAN_AMT, TRAN_TYPE, ADJ_AMT)
    values (4, to_date('01-01-2007', 'dd-mm-yyyy'), 100, 'D', 0);
    insert into TRANS_TABLE (CUST_ID, TRAN_DATE, TRAN_AMT, TRAN_TYPE, ADJ_AMT)
    values (4, to_date('10-01-2007', 'dd-mm-yyyy'), 100, 'D', 0);
    insert into TRANS_TABLE (CUST_ID, TRAN_DATE, TRAN_AMT, TRAN_TYPE, ADJ_AMT)
    values (4, to_date('08-01-2007', 'dd-mm-yyyy'), 100, 'D', 0);
    insert into TRANS_TABLE (CUST_ID, TRAN_DATE, TRAN_AMT, TRAN_TYPE, ADJ_AMT)
    values (4, to_date('06-01-2007', 'dd-mm-yyyy'), 100, 'D', 0);
    insert into TRANS_TABLE (CUST_ID, TRAN_DATE, TRAN_AMT, TRAN_TYPE, ADJ_AMT)
    values (3, to_date('08-01-2007', 'dd-mm-yyyy'), 100, 'D', 0);
    insert into TRANS_TABLE (CUST_ID, TRAN_DATE, TRAN_AMT, TRAN_TYPE, ADJ_AMT)
    values (3, to_date('05-01-2007', 'dd-mm-yyyy'), 100, 'D', 0);
    insert into TRANS_TABLE (CUST_ID, TRAN_DATE, TRAN_AMT, TRAN_TYPE, ADJ_AMT)
    values (3, to_date('01-01-2007', 'dd-mm-yyyy'), 100, 'D', 0);
    insert into TRANS_TABLE (CUST_ID, TRAN_DATE, TRAN_AMT, TRAN_TYPE, ADJ_AMT)
    values (2, to_date('05-02-2007', 'dd-mm-yyyy'), 200, 'C', 110);
    insert into TRANS_TABLE (CUST_ID, TRAN_DATE, TRAN_AMT, TRAN_TYPE, ADJ_AMT)
    values (2, to_date('01-02-2007', 'dd-mm-yyyy'), 90, 'C', 0);
    insert into TRANS_TABLE (CUST_ID, TRAN_DATE, TRAN_AMT, TRAN_TYPE, ADJ_AMT)
    values (2, to_date('05-01-2007', 'dd-mm-yyyy'), 100, 'D', 0);
    insert into TRANS_TABLE (CUST_ID, TRAN_DATE, TRAN_AMT, TRAN_TYPE, ADJ_AMT)
    values (2, to_date('01-01-2007', 'dd-mm-yyyy'), 100, 'D', 0);
    insert into TRANS_TABLE (CUST_ID, TRAN_DATE, TRAN_AMT, TRAN_TYPE, ADJ_AMT)
    values (2, to_date('09-01-2007', 'dd-mm-yyyy'), 100, 'D', 0);
    insert into TRANS_TABLE (CUST_ID, TRAN_DATE, TRAN_AMT, TRAN_TYPE, ADJ_AMT)
    values (2, to_date('08-01-2007', 'dd-mm-yyyy'), 100, 'D', 0);
    insert into TRANS_TABLE (CUST_ID, TRAN_DATE, TRAN_AMT, TRAN_TYPE, ADJ_AMT)
    values (1, to_date('08-02-2007', 'dd-mm-yyyy'), 300, 'C', 100);
    insert into TRANS_TABLE (CUST_ID, TRAN_DATE, TRAN_AMT, TRAN_TYPE, ADJ_AMT)
    values (1, to_date('05-02-2007', 'dd-mm-yyyy'), 200, 'C', 120);
    insert into TRANS_TABLE (CUST_ID, TRAN_DATE, TRAN_AMT, TRAN_TYPE, ADJ_AMT)
    values (1, to_date('01-02-2007', 'dd-mm-yyyy'), 80, 'C', 0);
    insert into TRANS_TABLE (CUST_ID, TRAN_DATE, TRAN_AMT, TRAN_TYPE, ADJ_AMT)
    values (1, to_date('01-01-2007', 'dd-mm-yyyy'), 100, 'D', 0);
    insert into TRANS_TABLE (CUST_ID, TRAN_DATE, TRAN_AMT, TRAN_TYPE, ADJ_AMT)
    values (1, to_date('01-01-2007', 'dd-mm-yyyy'), 100, 'D', 0);

    Hitherto an attempt:
    test@ORA92>
    test@ORA92> select * from trans_table;
       CUST_ID TRAN_DATE             TRAN_AMT T    ADJ_AMT
             4 02/01/2007 00:00:00        100 C          0
             4 01/05/2007 00:00:00        100 D          0
             4 01/01/2007 00:00:00        100 D          0
             4 01/10/2007 00:00:00        100 D          0
             4 01/08/2007 00:00:00        100 D          0
             4 01/06/2007 00:00:00        100 D          0
             3 01/08/2007 00:00:00        100 D          0
             3 01/05/2007 00:00:00        100 D          0
             3 01/01/2007 00:00:00        100 D          0
             2 02/05/2007 00:00:00        200 C        110
             2 02/01/2007 00:00:00         90 C          0
             2 01/05/2007 00:00:00        100 D          0
             2 01/01/2007 00:00:00        100 D          0
             2 01/09/2007 00:00:00        100 D          0
             2 01/08/2007 00:00:00        100 D          0
             1 02/08/2007 00:00:00        300 C        100
             1 02/05/2007 00:00:00        200 C        120
             1 02/01/2007 00:00:00         80 C          0
             1 01/01/2007 00:00:00        100 D          0
             1 01/01/2007 00:00:00        100 D          0
    20 rows selected.
    test@ORA92>
    test@ORA92> select
      2    cust_id,
      3    max(case when tran_type = 'D' then tran_amt else 0 end) as max_c,
      4    max(case when tran_type = 'C' then tran_amt else 0 end) as max_d
      5  from trans_table
      6  group by cust_id;
       CUST_ID      MAX_C      MAX_D
             1        100        300
             2        100        200
             3        100          0
             4        100        100
    4 rows selected.
    test@ORA92>
    test@ORA92>Cheers
    pratz

  • Need to write a query for extractions

    How can I extract the following data from Oracle:
    1. Segment1 and description from mtl_system_items_b
    2. Onhand quantity that is orderable (Not under the WIP manufacturing or PO)
    3. Onhand quantity that not orderable (That is under WIP manufacturing or PO)
    4. Retail Price of these items.
    There is only one organization_id =21 needs to be considered. This extract needs to be a daily kind of an extract. If you can help me in writing the query for all the fields above with proper joins, I'll really appreciate.
    Thanks & Regards
    KM

    Hi,
    Primary_uom_code and Primary_transaction_quantity shows the items quantity on the basis of primary code
    whereas Secondary_uom_code and secondary_transction_quantity shows the items quantity on different code.
    e.g. suppose you have an item Pen opened on the primary code as Each. 1 Each = 1 Pen.
    You have a conversion set as 10 Each = 1 Pkt.
    At the time of transaction if you selects as 1 Pkt,
    The primary_transaction_quantity will show 10 Each where as the secondary_transaction_quantity will show 1Pkt.
    Now as the transaction has done as Pkt the column Transaction_quantity will display 10Pkt.
    If you have done this transaction on the primary code as 10 Each.
    The primary_transaction_quantity would show the same 10 Each but the Secondary_transaction_quantity will by
    null and the transaction_quantity will be 10 Each.
    Hope this will clarify the issue.
    2) why you want to join these tables
    How can I join the following tables: qp_list_lines and mtl_system_items_b? I want to find the price of each
    item. I tried using inventory_item_id but it does not work as inventory_item_id can be null in qp_list_lines table.i have not been able to find any thing in table qp_list_lines.

  • How to all  those set of records for which a given field have same value.

    Hi,
    I've a table
    T1 as
    id val
    1 A
    2 B
    3 A
    4 C
    5 D
    6 A
    7 D
    Now i want to write a query that'll return only those val for which there r more than one existence of val.
    result desired is:
    val count(val)
    A 3
    D 2
    Thanks
    Amitesh

    This?
    SQL> select * from t;
            ID VAL                                                                 
             1 A                                                                   
             2 B                                                                   
             3 A                                                                   
    SQL> select val,count(*) c
      2  from t
      3  group by val
      4  having count(*) > 1;
    VAL     C                                                              
    A              2
    Message was edited by:
            jeneesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to write a query for this data??

    In this table i have column dob which is DATE type,for example 12-jan-89 I want output like this
       Year              Day
    12-jan-89         Thusrs_day
    12-jan-90          Friday
    upto
    12-jan-14        sunday

    krishnagopi wrote:
    No not like that ,I want up to 2014 year
    Ok, so lets say you have table like this
    SQL> create table my_table(dob date);
    Table created.
    SQL> insert into my_table (dob) values( to_date('12-jan-1989', 'dd-mon-yyyy'));
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from my_table;
    DOB
    12-JAN-89
    You can write a query like this
    select dob + (level -1) dob
          , to_char(dob + (level -1), 'fmDay') day_
       from my_table
    connect
         by level <= (dob + interval '25' year) - dob + 1;

  • Query for select CLOB data field

    Hi All,
    I want to know how to write a SQL query for select CLOB tyoe data from a tablw. when I am trying to use the simple SQL it gives an messageLOB types requires OCI8 mode and currently uasing OCI7 ode.
    Also I am not aware of oci mode?
    If its working for OCI8 mode how I should changer it in to OCI8 mode? (I am using 10g rel 2)
    Thans and regards
    Buddhike

    Hi ,
    i don't want to use loop (sy-tabix) ..
    any particular reason for this ?
    as u cannot automatically generate serial number, u have to go for loop....endloop.
    Thanks
    Karthik

  • How to write a query for AFTER DATE

    Hello Experts,
    I’m new to SQL and stuck on a query. How would you write SQL Code for the following query:
    The HR Department wants to determine the names of all employees who were hired after Davies:
    Thanks in advance.

    Hello,
    You need to change to the table name you have in your schema and in this case its "employees". Don't hard code date in where clause you might have different requirement later ;)
    SELECT *
    FROM employees
    WHERE hire_date > (SELECT hire_date
    FROM employees
    WHERE name = 'Davies');Regards

Maybe you are looking for

  • Lost keypresses and mouse clicks:  Hardware problem?

    I recently bought an Intel MBP, and I've been noticing strange behaviors with regard to keypresses and mouse (touchpad) clicks getting lost sometimes. The problems I'm having are hard to reproduce intentionally, but I can hear the keypresses and mous

  • Decisions with fresh install in windows 7 64 bit

    Hi community, I'm setting up a new laptop running windows 7 64 bit, and I'm trying to decide the best way to serve Application Express. I count 5 main options 1) Embedded Gateway 2) Install the complete 11g "companion" tier 3) Use Apex Listener EA wi

  • How to attach a document using the Send mail component

    Hello, I would like to know how to attach a document in a email using the Send mail component. There are these nodes into the atom but I don't know how to use it. <attachment doc="/ds/grp/doc" pltype="xml">           <xsl:copy-of select="/vpf:Msg/vpf

  • How to get ACK ID inside the BPM

    Hi, In my BPM Scenario,I want to update the database table as soon as the file is created in the destination system.So in the Send step I used Transport Acknowledgement option but I don't know how to get the ACK Id inside the BPM.Please help me. Rega

  • Syncing iphone to a new itunes library on new computer.

    Does anyone know how to sync my iphone to another computer without having to erase everything and start over?  My old computer crashed, and I recently got a new one with windows 8 installed.  Anyone who can help, it is REALLY appreciated.