How to filter the result by using a Quarter fields

How can i fiter the output by using the quarter field for example I want to display the output for letting date 07060801 and quarter 1(Q1-2007) thanks
SELECT tab.description, tab.itmenum, tab.units, tab.countyname, tab.datelet,'Q'||tab.Quarter,
       tab.contid, tab.vendor, tab.vendorname, tab.quantity, tab.EngineersPrice ,
        (tab.EngineersPrice*tab.quantity) EngineersTotal, tab.vendorsPrice,
       (tab.quantity * tab.vendorsPrice) VendorsTotal
  FROM (SELECT   INITCAP (i.idescrl || '  ' || e.isupdes) description,
                 e.isupdes, i.idescrl, SUBSTR (e.eiitem, 1, 4)|| '.'|| SUBSTR (e.eiitem, 5, 9) itmenum,
                 e.eiitem, func_get_unit_name (iunits) units,
                 INITCAP (func_get_county_name (p.ccnty1)) countyname,
                 b.datelet,TO_CHAR(b.datelet, 'Q-YYYY') Quarter, p.contid, d.vendor, l.CALL, g.csecnum, e.iplineno,                         
                 SUM (e.iqty) quantity,
                 (TRIM (d.vendor) || ' : ' || INITCAP (v.vnamel)) vendorname,
                       (SELECT br.bidprice
                    FROM bidtabs br
                         --------------------Select Letting Dates-------------------------------
                   WHERE br.letting  between '&lettingDatePlease' and  '&lettingDatePlease2'
                     AND br.lineflag = 'L'                                   
                     AND br.iplineno = e.iplineno
                     AND br.CALL = l.CALL
                     AND br.vendor = d.vendor) vendorsPrice,
                     (SELECT DISTINCT pi.price
                             FROM propitem pi
                            WHERE pi.contid = p.contid
                                     AND pi.lineflag='L'
                                     AND trim(pi.iplineno) <> ' '
                              AND trim(pi.iplineno) = trim(e.iplineno)) EngineersPrice
            FROM itemlist i,
                 estitem e,
                 estcatg g,
                 propproj x,
                 proposal p,
                 letprop l,
                 bidlet b,
                 bidders d,
                 vendor v
           WHERE p.contid = x.contid
             AND x.pcn = g.pcn
             AND e.pcn = g.pcn
             AND e.cn = g.cn
             AND i.item = e.eiitem
             AND i.ispecyr = p.cspecyr
             AND e.iplineno <> ' '
             AND e.eiitem <> '2550601/01000'
             AND e.eiitem <> '2565601/00031'
             AND e.eiitem <> '2565601/00033'
             AND e.eiitem <> '2402601/01000'
                -----Select Item Number----------
             AND e.eiitem = '&itemNumberPlease'
             AND l.lcontid = p.contid
             AND l.letting = b.letting
             AND l.letting = d.letting
             AND l.CALL = d.CALL
               -- AND l.LETSTAT='A'---------------------why 6/22 is not included----------------------------work with this-------------------------
             AND d.vendor = v.vendor
                ------Select Letting Dates--------
             AND b.letting between '&lettingDatePlease' and  '&lettingDatePlease2'
        GROUP BY p.contid,
                       d.vendor,
                 g.csecnum,
                 e.iplineno,
                 SUBSTR (e.eiitem, 1, 4) || '.' || SUBSTR (e.eiitem, 5, 9),
                 b.datelet,
                 l.CALL,
                 e.eiitem,
                 (i.idescrl || '  ' || e.isupdes),
                 func_get_unit_name (iunits),                
                 iunits,
                 p.ccnty1,
                 i.idescrl,
                 e.isupdes,
                 i.idescrl,
                 v.vnamel,
                 e.isupdes)  tab
DESCRIPTION     ITMENUM     UNITS     COUNTYNAME     DATELET     'Q'||TAB.QUARTER     CONTID     VENDOR     VENDORNAME     QUANTITY     ENGINEERSPRICE     ENGINEERSTOTAL     VENDORSPRICE     VENDORSTOTAL
Mobilization        2021.501/00010     LUMP SUM     Hennepin     3/30/2007     Q1-2007     060048              ALS0010            ALS0010 : Ames / Lunda / Shafer (Jv)     1     11376150     11376150     14357900     14357900
Mobilization        2021.501/00010     LUMP SUM     Hennepin     3/30/2007     Q1-2007     060048              MP0001             MP0001 : Mccrossan/Pcl (Jv)     1     11376150     11376150     15600000     15600000
Mobilization        2021.501/00010     LUMP SUM     Wright     5/18/2007     Q2-2007     070002              C320               C320 : Central Specialties Inc     1     130459     130459     637860     637860
Mobilization        2021.501/00010     LUMP SUM     Wright     5/18/2007     Q2-2007     070002              D420               D420 : Duininck Brothers Inc     1     130459     130459     362000     362000
Mobilization        2021.501/00010     LUMP SUM     Wright     5/18/2007     Q2-2007     070002              H151               H151 : Hardrives Inc     1     130459     130459     516000     516000
Mobilization        2021.501/00010     LUMP SUM     Wright     5/18/2007     Q2-2007     070002              H438               H438 : Hoffman Construction Company     1     130459     130459     255000     255000
Mobilization        2021.501/00010     LUMP SUM     Wright     5/18/2007     Q2-2007     070002              K0037              K0037 : Knife River Corporation - North Central     1     130459     130459     290953.37     290953.37
Mobilization        2021.501/00010     LUMP SUM     Wright     5/18/2007     Q2-2007     070002              M0027              M0027 : Midwest Contracting Llc     1     130459     130459     285000     285000

Hi gourous,
I am sorry, my question is a little bit more complex. I hope I may repost here, without opening another thread. Thank you for your understanding.
The EQUIPE_ID column of the table refers to a team. This id is returned by a select list named :P60_EQUIPE_ID which select all the EQUIPE_ID available. Then if one choose a team in this select list, the choosen EQUIPE_ID is returned. If nothing is selected in the select list, then a null value is returned.
The AGENT_ID refers to a person. This id is returned by a select list named :P60_AGENT_ID, which returns all the members of the previously selected EQUIPE_ID. If nothing is selected, then a null value is returned.
A team may have several persons belonging to that team.
I would like that if a TEAM is selected, without selecting an agent in the :P60_AGENT_ID select list (returning a null value in this case), then all the people belonging to that theam will be retrieved by the select QUERY of a report.
Then one could refine the query by selecting a person in the :P60_AGENT_ID select list in order to view only the people of that team in the report.
To resume :
IF EQUIPE_ID is NULL -> all the teams and all the persons are displayed in the report.
IF EQUIPE_ID is NOT NULL and :P60_AGENT_ID is NULL -> All the people of that selected team appears on the report
IF EQUIPE_ID is NOT NULL and :P60_AGENT_ID is NOT NULL -> The report displays only the results of the query for that person of that team.
Thank you for your kind help !

Similar Messages

  • How to filter listResourceObjects result?

    I am using the following code to get LDAP groups back:
    <invoke class='com.waveset.ui.FormUtil' name='listResourceObjects'>
    <ref>:display.session</ref>
    <s>Group</s>
    <s>LDAP</s>
    <map>
    <s>searchFilter</s>
    <s>(cn=DB2 Administrators)</s>
    </map>
    <s>true</s>
    </invoke>I expected that the result should only be one group. Instead I got all the groups back. Does anyone know how to filter the result?
    Thanks a lot!

    Hi,
    Thanks for your code posting.
    One thing I noticed is that your code calls
    the getResourceObjects method, whereas
    the original poster (and myself) are trying to
    call the listResourceObjects method.
    If I call getResourceObjects, I get back just the
    objects I need.
    However if I call listResourceObjects I get back
    a list of all the groupofuniquenames objects in my ldap tree.
    I really need the names of the objects and not the
    objects themselves, so getResourceObjects won't
    work for me.
    This code works, it returns four objects:
    <invoke name='getResourceObjects' class='com.waveset.ui.FormUtil'>
    <ref>:display.session</ref>
    <s>Group</s>
    <s>LDAP</s>
    <map>
    <s>searchContext</s>
    <ref>searchContext</ref>
    <s>searchFilter</s>
    <concat>
    <s>(uniqueMember=uid=</s>
    <ref>uid</ref>
    </concat>
    <s>searchScope</s>
    <s>subTree</s>
    </map>
    </invoke>
    This code does not work. It returns the name of every object
    where or not the user is a member. It just seems to ignore
    my searchFilter and always send a default one to the ldap server:
    <invoke name='listResourceObjects' class='com.waveset.ui.FormUtil'>
    <ref>:display.session</ref>
    <s>Group</s>
    <s>LDAP</s>
    <map>
    <s>searchContext</s>
    <ref>searchContext</ref>
    <s>searchFilter</s>
    <concat>
    <s>(uniqueMember=uid=</s>
    <ref>uid</ref>
    </concat>
    <s>searchScope</s>
    <s>subTree</s>
    </map>
    <s>false</s>
    </invoke>
    Thanks,
    John I

  • How can i pass a parameter to the query to filter the result of this lookup

    Hello,
    i'm developping a web application with JDeveloper 10.1.2 and JHeadStart.
    i realy need to know how can i filter the lookup (LOV) query result.
    in other word, when i click on the lookup, it show all the row that exist in may data base table.
    what i want is how can i pass a parameter to the query to filter the result of this lookup ?
    Thank you

    Hi,
    have a look if this helps
    http://oracle.com/technology/products/jdev/tips/fnimphius/restrictlovlist/restrictlov.html
    Frank

  • In BI how to filter the selection options based on inputs on top field

    Hi Friends,
    In BI, How to filter the selection options based on inputs on top field.
    The system should automatically filter the lower level drop downs based on the selection of a higher level.
    For e.g. :
    If a user selects a Country then the States drop down should only display the State's belongs to the Country. Similarly when a State is selected, the District drop down should display only those District's belongs to the State.
    Thanks in Advance.
    Regards
    Jayaram M

    Hi Anil,
    Thanks for reply but I couldn't use Compounding Characteristic here. Need some other solution.
    Regards
    Jayaram M

  • How to filter the data in different sections (e.g. Report Footers)?

    Hi,
    I am using Crystal Reports 11 to generate cross-tables.
    I plan to generate 3 cross-tabs, and each cross-table will be put in a section. For example, cross-tab1 in Report Footer a; cross-tab2 in Report Footer b; cross-tab3 in Report Footer c.
    I know use "Select Expert" to filter data. But, it seems that "Select Expert" filters data for the whole report.
    I want to filter the data for each cross-table separately. For example, filter cross-tab1 based on condition1; filter cross-tab2 based on condition2; filter cross-tab3 based on condition3.
    How to filter the data in different sections (e.g. Report Footers)?
    Thank you in advance.

    Hi,
    Now that you've inserted the subreport just right-click the sub-report and click Edit. The Design page for sub-report should open up.
    You can now insert the cross-tab on the Report Header and insert a record selection formula of your choice.
    Also, suppress all the other sections of the subreport so the Main report only shows the crosstab without any spaces.
    Do the same for all the subreports.
    -Abhilash

  • Call function in background task... How to get the result?

    I want to use Call function in background task parameter.
    But I cannot find the result of this function. (No export parameter, no table result, no exception)
    How to get the result of this function module? Correct or not?

    Hi Heinz,
    You can check the result in SM58 transaction.
    For more information pls. refer this thread :
    No IMPORTING parameters allowed in CALL FUNCTION IN BACKGROUND TASK
    Best regards,
    Prashant

  • How to access the Result of an fileReference request ?

    Hello,
    I have adjusted this example ( http://cookbooks.adobe.com/post_Uploading_files_from_Flex_using_PHP-5241.html ) of uploading an Image to an Server.
    But the Problem i have is that i wanted to return from the php file some informations for example if the image is really uploaded.
    Does someone know how to read the result that comes in an xml format in actionscript ?
    PHP file:
    $tempFile = $_FILES['file']['tmp_name'];
    $fileName = $_FILES['file']['name'];
    $fileSize = $_FILES['file']['size'];
    $upload = move_uploaded_file($tempFile, "./" . $fileName);
    if(!$upload) {
    echo "<failure>"."upload failed"."</failure>";
    Thank you,
    Zombiecook

    Hi,
      if you schedule the job then you can create the spool..
      But if you want to create a spool while executing in foreground...
      Then use this code..before calling the ALV FM..
      DATA: DAYS(1)  TYPE N VALUE 2,
          COUNT(3) TYPE N VALUE 1,
          VALID    TYPE C.
    DATA: PARAMS LIKE PRI_PARAMS.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
      EXPORTING DESTINATION           = 'LOCL'
                COPIES                = COUNT
                LIST_NAME             = 'TEST'
                LIST_TEXT             = 'First NEW-PAGE PRINT ON'
                RELEASE               = 'X'
                IMMEDIATELY           = ' '
                NEW_LIST_ID           = 'X'
                EXPIRATION            = DAYS
                LINE_SIZE             = 79
                LINE_COUNT            = 23
                LAYOUT                = 'X_PAPER'
                SAP_COVER_PAGE        = 'X'
                RECEIVER              = 'SAP*'
                DEPARTMENT            = 'System'
                NO_DIALOG             = ' '
      IMPORTING OUT_PARAMETERS        = PARAMS
                VALID                 = VALID.
    IF VALID <> SPACE.
      NEW-PAGE PRINT ON PARAMETERS PARAMS NO DIALOG.
      WRITE / 'First Spool'.
    ENDIF.
    Thanks,
    Naren

  • How to display the result of  excutions(insert/update/delete rows)

    Hello.
    Does anyone know how to display the result of scenario executions just like a scenario executions tab of package (insert/update/delete rows) in other screen (in the intergated operating platform for operators using http)
    In additional, I also like to show the hierarchy of scenario in the same view.
    So, I need the query using the information of the ODI repository.
    If it is possible, I also like to have the decription of the tables in the ODI repository.
    Can anyone tell me how can I get the information of the counts of excution?
    Thanks in advance.

    Hi,
    You can get that information from the API getPrevStepLog. Does it work for you?
    Download the last API reference manual from:
    http://www.oracle.com/technology/products/oracle-data-integrator/10.1.3/htdocs/1013_support.html#docs

  • How to filter the data in dropdown?

    Hello,
    How to filter the data
    I got all the project name in dropdown when you select the project name in other textbox the project id will come automatically.
    so I want to get only those project name that is assigned to that particular user.
    I have
    ProjectName(dropdown),
    ProjectId(Textbox),
    Employee code(Unique value),
    employee Id (Unique for particular employee means if User A works on 5 projects so for all 5 projects the employee Id will be same),
    Project Id( 5 projects 5 different id)
    I didnt get the exact formula or I have to use any javascript code.Any help...
    Thanks,

    If I am understanding correctly, you want to populate a drop down with values from a list.
    Using InfoPath:
    right click on the drop down to be populated, and choose drop down list box properties.
    add the list with the values as a data source.
    click the filter box next to entries.
    select the field you want from the other list.
    click filter data.
    set the filter (click AND if you need more lines).
    click OK on any dialogs you need to to get back to the editor.
    Test your form.

  • How to write the given query using 'ANY ' operator

    Hi,
    How to write the given query using 'ANY ' operator , I dont need to fetch to grade_master table twice in database, just need to fetch within the result set.
    SELECT dsg_code,dsg_name,dsg_grade FROM designation_master WHERE dsg_orgn='&&Orgn' and dsg_ctry='&&ctry'
    And dsg_loc ='&&loc' And dsg_oru = '&&oru' and dsg_grade in decode('&&radio_group',
    1, SELECT grd_code FROM grade_master WHERE grd_osm_code in (Select grd_osm_code FROM grade_master WHERE grd_orgn='&&Orgn' and grd_ctry='&&ctry' And grd_loc ='&&loc' And grd_oru = '&&oru' and grd_code ='&&emp_grade'),
    2, SELECT grd_code FROM grade_master WHERE grd_osm_code > (Select grd_osm_code FROM grade_master WHERE grd_orgn='&&orgn' and grd_ctry='&&ctry' and grd_loc ='&&loc' And grd_oru = '&&oru' and grd_code),
    3, SELECT grd_code FROM grade_master WHERE grd_osm_code < (Select grd_osm_code FROM grade_master WHERE grd_orgn='&&orgn' and grd_ctry='&&ctry' And grd_loc ='&&loc' And grd_oru = '&&oru' and grd_code ='&&emp_grade'))
    thanks
    rincy

    Hi,
    One thing I understood my your issue is you want to perform, execution of query once or fetch the results sets my minimizing the number of times executions of queries. It would be hard for us to check in this way, atleast provide some temporary data and some business rules. Only I can IN, >, < (queries logical conditons on inner query)
    - Pavan Kumar N
    - ORACLE OCP - 9i/10g
    https://www.oracleinternals.blogspot.com

  • Af:query - How to get the result rowsets

    Hi,
    I have a requirement where i need to search the db rows on and append the results the adf rich table on each search.
    For this i am using af:query component. And trying to get the result rows for the named criteria.
    String mexpr = "#{bindings.DestinDescVOCriteriaQuery.processQuery}";
    processMethodExpression(mexpr, queryEvent, QueryEvent.class);
    ViewCriteriaManager vcm = getDestinDescViewObj().getViewCriteriaManager();
    ViewCriteria vc = vcm.getViewCriteria("DestinDescVOCriteria");
    getDestinDescViewObj().applyViewCriteria(vc);
    AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
    adfFacesContext.addPartialTarget(tblDestinDesc);
    However on each click of search the rows searched in the previous attempt are not retained.
    Can anyone let me know how to get the result from named criteria and append it the table?
    Thanks
    Ajay

    Can anyone help?

  • How to get the results for given Bind Variable

    Hi
    Can any one help me how to get the result rows from the View Object after executing the view object query by setting bind variable?
    snippet as follows
    viewObject.setNamedWherClauseParams("name","hei");
    viewObject.executeQuery();
    How to get the results from viewObject is my question..?
    Thanks in advance

    Should be something like
    while (vo.hasNext()){
    Row r = vo.next();
    r.getAttribute....
    You might want to read the "most commonly used methods" appendix in the ADF Developer Guide.

  • How to filter the data on Reports from collected from differnet Agents

    1) I have to write a Plug-in which would fetch the same type of data from 7 Agents. I need to generate the report for each Agent separately,This plug-in will be deployed in various different environment. So I will not know the host name as it will be deployed different environment. Can anyone suggest how to filter the data for each agent from the table. I see one solution of using Bind variable for the Target GUID in PL/SQL file. Can you please suggest if there is any other better way of doing this.????
    Also Can you please suggest what are the best ways to debug the OEM Plug-in?
    Thanks Anyway.....

    What I mean filtering data means displaying data for each Agent Seperatly. Assume I have collected Filesystem data from 5 Agents (5 different server). Now I want do display file system data for Agent1 (server 1). How would I fetch it from MGMT$Metric_Current. Currently I use a bind variable
    ??EMIP_BIND_TARGET_GUID?? to filter the data for a Agent from MGMT$Metric_Current view. I compare Target Name entered while deploying Plug-in with the Target_Name column of specified view.Is there any other way of fetching data from this table for a Agent?
    I hope I am prety clear now. My Problem is IO dont want to force user to enter exact Server name while deploying Plug-in.
    Thanks......

  • How to schedule the background job using current selection screen field val

    Hello Friends,
    How to schedule the background job using current selection screen field values.
    after completion of the job the spool should be sent as a mail to SAP Inbox.
    Is there any way to create the variant dynamically by reading the current selection screen values.
    Thanks,
    Ravi

    Hi,
    To get the variant details you can use teh following FM.
    'RS_VARIANT_CONTENTS'.
    Regards,
    Ankur Parab

  • How to display the results in order by based on search value

    Hi All,
    how to display the results in the below order.
    CREATE TABLE TEST( SONGID  NUMBER, TITLE   VARCHAR2(200))
    INSERT INTO TEST(SONGID,TITLE) VALUES (10,'AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (11,'CICCONE, MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (12,'DALLIN, MADONNA LOUISE/STOCK');
    INSERT INTO TEST(SONGID,TITLE) VALUES (13,'MADONNA');
    INSERT INTO TEST(SONGID,TITLE) VALUES (14,'MADONNA (A)/ AHMADZAI, MIRWAIS (C)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (15,'MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (16,'MIRWAIS AHMADZAI, MADONNA');     
    INSERT INTO TEST(SONGID,TITLE) VALUES (17,'MIRWAIS (CA)/ MADONNA (CA),AHMADZAI');
    INSERT INTO TEST(SONGID,TITLE) VALUES (18,'MADONNA (CA),CICCONE');
    SELECT *FROM  TEST WHERE INSTR (TITLE, 'MADONNA') > 0
    output:
    SONGID     TITLE
    10     AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)
    11     CICCONE, MADONNA (CA)
    12     DALLIN, MADONNA LOUISE/STOCK
    13     MADONNA
    14     MADONNA (A)/ AHMADZAI, MIRWAIS (C)
    15     MADONNA (CA)
    16     MIRWAIS AHMADZAI, MADONNA
    17     MIRWAIS (CA)/ MADONNA (CA),AHMADZAI
    18     MADONNA (CA),CICCONE
    Expected output :
    13     MADONNA
    14     MADONNA (A)/ AHMADZAI, MIRWAIS (C)
    15     MADONNA (CA)
    18     MADONNA (CA),CICCONE
    ...if user searches with 'MADONNA' , I have to display the results like title starts with 'MADONNA' first then rest of the records.
    Please let me know is it possible to display the results in that order.
    Regards,
    Rajasekhar

    This may be a bit more accurate:
    SQL> SELECT *
      2  FROM   TEST
      3  WHERE  INSTR (TITLE, 'MADONNA') > 0
      4  ORDER  BY INSTR (TITLE, 'MADONNA')
      5           ,TITLE
      6  ;
                  SONGID TITLE
                      13 MADONNA
                      14 MADONNA (A)/ AHMADZAI, MIRWAIS (C)
                      15 MADONNA (CA)
                      18 MADONNA (CA),CICCONE
                      12 DALLIN, MADONNA LOUISE/STOCK
                      11 CICCONE, MADONNA (CA)
                      17 MIRWAIS (CA)/ MADONNA (CA),AHMADZAI
                      16 MIRWAIS AHMADZAI, MADONNA
                      10 AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)

Maybe you are looking for