OBIEE - Use CURRENT_DATE in where condition

Hello All,
I want to use CURRENT_DATE in one column named "Incident Date/System"."Submit Date(GMT)". I just want to extract CURRENT_DATE(06-02-2013) data.
I want to use that field like "Incident Date/System"."Submit Date(GMT)" = CURRENT_DATE. But i am not able to do it. Please help me on this.
*<code>*
SELECT CURRENT_DATE saw_0, "Incident Basic Details"."Incident ID" saw_1, "Incident Basic Details".Impact saw_2, "Incident Basic Details"."Incident Details" saw_3, "Incident Customer"."Customer Name" saw_4, "Incident Customer"."Customer ID" saw_5, "Incident Assignment"."Assigned Group" saw_6 FROM "Enterprise Remedy" WHERE "Incident Assignment"."Assigned Group" = 'Standard Oracle Production Support' ORDER BY saw_0, saw_1, saw_2, saw_3, saw_4, saw_5, saw_6
*<code>*
With CURRENT_DATE
*<code>*
SELECT CURRENT_DATE saw_0, "Incident Basic Details"."Incident ID" saw_1, "Incident Basic Details".Impact saw_2, "Incident Basic Details"."Incident Details" saw_3, "Incident Customer"."Customer Name" saw_4, "Incident Customer"."Customer ID" saw_5, "Incident Assignment"."Assigned Group" saw_6 FROM "Enterprise Remedy" WHERE "Incident Assignment"."Assigned Group" = 'Standard Oracle Production Support' AND "Incident Date/System"."Submit Date(GMT)" = CURRENT_DATE ORDER BY saw_0, saw_1, saw_2, saw_3, saw_4, saw_5, saw_6
*<code>*
Thanks,
Jiten

On Column "Incident Date/System"."Submit Date(GMT)" click on Filter->Add Button->SQL Expression and then use current_date
or else
On Column "Incident Date/System"."Submit Date(GMT)" click on Filter->Advanced Button->Convert this filter to SQL
and then use current_date
Before doing this I would suggest to validate the data format and values, you might need to cast where ever needed.
Mark if helps

Similar Messages

  • Can we use EXISTS in where condition

    hi all,
    can we use EXISTS (instead of IN) in where condition of a query which is not part of a subquery ?
    for e.g:
    update gpf_vou_sm set up_amt=0 where src_cd exists ('1101','1201');
    the query works fine with the IN operator in place of EXISTS.
    anybody please help.
    thomas k prakash

    Hi:
    You can use EXISTS in where clause but not in that syntax.
    UPDATE gpf_vou_sm g
       SET up_amt = 0
    WHERE EXISTS (SELECT 1
                     FROM gpf_vou_sm
                    WHERE src_cd IN ('1101', '1201') AND id = g.id);Using IN in your case is better...
    Saad,

  • For all entries Where condition character length partilally has to be used

    Hi,
    I need to fetch all the data reocrds of one internal table into the other with the condition that in one of the field of first internal table only partial length of the character has to be used as a where condition.
    Example:
    Select xxxx
              yyyyy
              zzzzz
    into it_tab2
    for all entries in itab1
    where field2 = itab1-field1(4).
    where field1 of itab1 has length of 8 and field2 belongs to itab2.
    As it throws the error msg :
    it will ignore the length restriction mentioned in where condition of the for all entries

    Hi.
    If you are trying to fetch from any database table based on your modified table use this logic.
    Dfine another internal table same as itab1, with field one lenght as 4 char.
    ex:
    data: begin of it_tab2.
            field1(4),
    end of it_tab2.
    loop at it_tab1.
    it_tab2 = itab1+0(4).
    append it_tab2.
    clear it_tab2.
    endloop.
    now you can fetch from database table....using it_tab2.
    Select xxxx
    yyyyy
    zzzzz
    into it_tab3
    for all entries in itab2
    where field2 = itab2-field1(4).
    If you only want to move the entries form one internal table to another internal table and truncate the field1 of itab1.
    then no need to use any for all entries...
    apply this logic
    data: begin of it_tab2.
            field1(4),
    end of it_tab2.
    loop at it_tab1.
    it_tab2 = itab1+0(4).
    append it_tab2.
    clear it_tab2.
    endloop.
    Regards,
    Satish

  • Checkbox Value in where condition of query

    Hi,
    I have a check box which shows values based on the LOV's . If i check on the checkbox the values that are selected on the check box must be used in the where condition to update the table.
    Please suggest me how to take the check box values.
    Am using the below methos to update but its not happening
    Declare
    old_cohort_name varchar2(500);           
    new_cohort_name varchar2(500);
    l_cohort_id apex_application_global.vc_arr2;
    begin
    l_cohort_id := apex_util.string_to_table(:P64_CASCADE_COHORT_NAMES);
    select cohort_name into old_cohort_name from study_cohort
    where cohort_id = :p64_cohort_id;
    select :P64_COHORT_NAME into new_cohort_name from dual;
    if old_cohort_name <> new_cohort_name then
    update study_cohort
    set      
    cohort_name = new_cohort_name
    where cohort_id = :p64_cohort_id and
    cohort_id = l_cohort_id; // here is the variable i am using when checkbox is checked
    End if;
    End;
    Please suggest me how to modify the code
    Tx
    Sudhri

    Hi Sudhri,
    where cohort_id = :p64_cohort_id and
    cohort_id = l_cohort_id; // here is the variable i am using when checkbox is checked If this is the code you are actually using, then the condition would only be met if l_cohort_id = :p64_cohort_id because you are using an AND condition over the same column in the where clause, so it will only return rows when both values are the same. Then, I think that it seems not to be working for you because :p64_cohort_id and l_cohort_id have different values, and no row is getting updated then. If the values you are selecting in your checkboxes are several ids of rows to update, besides the one with id :p64_cohort_id, then maybe the condition you need is something like this:
    WHERE cohort_id = :p64_cohort_id OR instr(l_cohort_id, cohort_id) != 0;Hope that helps.
    Regards,
    Sergio

  • Error: No first field of table index in where condition

    I've got following errors while doing code inspector or extended syntax check:
    (Large table VEKP: No first field of table index in where condition).
    My code is like below as per as code-logic.
    What's the necessary changes to do to remove the above code?
    SELECT VENUM
                 BRGEW
                 BTGEW
                 BTVOL
                 VOLEH
                 VHILM
                 LMENG
                 BREIT
                 HOEHE
                 MEABM
                 VPOBJKEY
                 FROM VEKP
                 INTO TABLE i_vekp
                 WHERE vpobjkey = w_mkpf-xblnr.
    IF sy-subrc = 0.
    SORT i_vekp BY venum.
    ENDIF.
    How can I remove the error? How to use index in where clause I'm not getting and on which key? or, should I use the statement "EC C1_NOFIRST to remove the error?
    Kindly guide.

    > should I use the statement "EC C1_NOFIRST to remove the error?
    you can not really ask this question in this forum. This check gives you hints to the most serious problems in database accesses, if you want to override it, then you should better forget about performance.
    If you are not familiar how databases use indexes, then check resources in the net or in books, in
    short they use indexes and the indexes are absolutly necessary with large tables, if you want to get
    good performance.
    But indexes can only be used in the order of their field, until a field is not used in the WHERE-condition, (gap). If the gap is already the first field, then the index can not be used at all.
    In your case there is not first field of any index specified in the WHERE condition, so the SELECT might be slow. Either you can add a condition on a first index field or you have to live with a poor performance.
    Siegfried

  • Please help - NE where condition in SELECT statement

    Dear experts,
    I am posting a section of my codes here for your review on performance tuning.
    In my second select statement, I used a "NE" where condition. I read somewhere in this forum that using "NE" where condition is not a good decision for improving codes' performance. What alternatives can I have to achieve the same purpose? May I use "NOT IN" here instead? Or do I use a LOOP for this (a rather manual way)?
    Just to let you all know that I still consider myself quite inexperienced in ABAP - please also let me know how I can better improvise my programming techniques in the posted codes here too.
    I will be most glad to provide you with further information if needed - just let me know.
    Many THANKS in advance!
    IF p_noncis = 'X'.      " Non CIS category of spend selected
        " zfi_cis_mat_grp is a bespoke table that stores all CIS MATKL
        " and it has two fields only - MANDT and MATKL
        SELECT * FROM zfi_cis_mat_grp    
        INTO TABLE gt_cis_mat_grp.
        IF gt_cis_mat_grp IS NOT INITIAL.
          SELECT ebeln
                 ebelp
               matkl
          FROM ekpo
          INTO TABLE gt_ekpo
          FOR ALL ENTRIES IN gt_cis_mat_grp
          WHERE matkl NE gt_cis_mat_grp-matkl.    " NE where condition - is this OK?
        ENDIF.
        IF gt_ekpo IS NOT INITIAL.
          IF s_sakto IS NOT INITIAL.
            SELECT ebeln
                   ebelp
                   sakto
            FROM ekkn
            INTO TABLE gt_ekkn
            FOR ALL ENTRIES IN gt_ekpo
            WHERE ebeln = gt_ekpo-ebeln AND
                  ebelp = gt_ekpo-ebelp AND
                  sakto IN s_sakto.
            IF gt_ekkn IS NOT INITIAL.
              SELECT bukrs
                     lifnr
                     belnr
                     budat
                     cpudt
                     xblnr
                     ebeln
                     ebelp
                     zfbdt
                     zterm
                     zlspr
              FROM bsik
              INTO TABLE gt_bsik
              FOR ALL ENTRIES IN gt_ekkn
              WHERE bukrs IN s_bukrs AND
                    lifnr IN s_lifnr AND
                    budat IN s_budat AND
                    cpudt IN s_cpudt AND
                    xblnr IN s_xblnr AND
                    ebeln = gt_ekkn-ebeln AND
                    ebelp = gt_ekkn-ebelp AND
                    qsskz NE ''.
            ENDIF.
          ELSE.
            SELECT bukrs
                   lifnr
                   belnr
                   budat
                   cpudt
                   xblnr
                   ebeln
                   ebelp
                   zfbdt
                   zterm
                   zlspr
            FROM bsik
            INTO TABLE gt_bsik
            FOR ALL ENTRIES IN gt_ekpo
            WHERE bukrs IN s_bukrs AND
                  lifnr IN s_lifnr AND
                  budat IN s_budat AND
                  cpudt IN s_cpudt AND
                  xblnr IN s_xblnr AND
                  ebeln = gt_ekpo-ebeln AND
                  ebelp = gt_ekpo-ebelp AND
                  qsskz NE ''.
          ENDIF.
        ENDIF.
      ELSE.      " Complete list of category of spend selected
        SELECT bukrs
               lifnr
               belnr
               budat
                  cpudt
               xblnr
               ebeln
               ebelp
               zfbdt
               zterm
               zlspr
        FROM bsik
        INTO TABLE gt_bsik
        WHERE bukrs IN s_bukrs AND
              lifnr IN s_lifnr AND
              budat IN s_budat AND
              cpudt IN s_cpudt AND
              xblnr IN s_xblnr AND
              qsskz NE ''.
      ENDIF.

    Hi,
    If you want to remove th NE option then try this way..
    SELECT bukrs
               lifnr
               belnr
               budat
                  cpudt
               xblnr
               ebeln
               ebelp
               zfbdt
               zterm
               zlspr
        FROM bsik
        INTO TABLE gt_bsik
        WHERE bukrs IN s_bukrs AND
              lifnr IN s_lifnr AND
              budat IN s_budat AND
              cpudt IN s_cpudt AND
              xblnr IN s_xblnr .
    IF SY-SUBRC EQ 0.
      Delete gt_bsik where qsskz EQ ' '.
    ENDIF.

  • Offset in where condition

    Hi All,
    How to use offset in where condition like
    l_client= sy-mandt.
    Select * from ztable where client(2) =  l_client(2).
    but this hsowing error message.
    Please how to use offset in where condition.
    Thanks

    >
    tarangini katta wrote:
    > HI all,
    >
    > I have z table like
    >
    > with thae values
    >
    > 123 710
    > 456 720
    > 123 710
    >
    > I want to get the records who is having offset 71 to my internal table.
    >
    > Can you please anybody help me.
    >
    > Thanks,
    Hi,
    Test the following Sample Code it will work for you.
    DATA: it_kna1 LIKE STANDARD TABLE OF kna1 WITH HEADER LINE.
    DATA: l_client LIKE sy-mandt.
    l_client = sy-mandt.
    SELECT * from kna1 CLIENT SPECIFIED
      into CORRESPONDING FIELDS OF TABLE it_kna1
      WHERE mandt like '71%'.
    Kind Regards,
    Faisal

  • Convert WHERE condition to OBIEE using available OBIEE function

    I have this WHERE condition which has to be attached to a Logical Table Source (Content Tab). This condition exists in my BO Universe and has to be applied to my OBIEE project.
    TRUNC(SYSDATE) >= NVL(QP.QP_LIST_LINES.start_date_active, TRUNC(SYSDATE))
    AND TRUNC(SYSDATE) < NVL(QP.QP_LIST_LINES.end_date_active,TRUNC(SYSDATE)+1)
    Using the functions in OBIEE, I ended up with this WHERE condition but seems not to work because when I compared the results, they are different.
    CURRENT_DATE >= IFNULL(ABCDE."Price List Lines"."Item Start Date", CURRENT_DATE ) AND CURRENT_DATE < IFNULL(ABCDE."Price List Lines"."Item End Date", CURRENT_DATE + 1)
    Please help me correct this.
    Thank you in advance.
    Message was edited by:
    user595459

    Hi, The TIMESTAMPADD function helped. I will take note of this. It's now working but noticed the performance (generating the report) is taking a long time. Would appreciate your advice. Thanks.

  • WHERE condition in OBIEE 11g

    HI gurus,
                    How can I use a WHERE condition in obiee 11g in the Column formula or in the BMM layer in the repository .
    Thanks in advance
    Reg,
    Niv

    Hi,
    In the Column formula, the functions like Case When clause (Category: Expressions) can always be used in the building the expression.
    For the above, there is always two options
    1. Derived from Physical Mappings - this will list only the physical tables that are pulled into the LTS of the logical table
    2. Derived from existing columns using an expression - this will list all the Logical tables in the RPD
    If you want to apply the filter i.e where clause on the entire table, then go to Content Tab of the LTS
    Enter your WHERE clause filters in the section - Use this "WHERE clause".....
    The above modifications will apply where clause on all the columns
    Please mark if it is helpful
    Srikanth

  • Concatenation error - when i use text column value in where condition.

    Hi,
    i am creating Materialized view using few columns from two tables and as per requirement i need to prepare select statement with where condition in another column.(new column)
    i tried like below....
    create materialized view MAIN
    refresh force on demand
    as
    select
    a.table_name,
    a.column_name,
    b.trial_name,
    'select * from '||a.table_name||' where '||a.column_name|| ' = '|| b.trial_name||';' "QUERY"
    from
    exp_csv_tB a,
    exp_csv_tr b;
    a.table name value is : monitoring_table
    a.column_name value is : study
    b.trial_name = fty777
    Materialized view created with extra column but it is not added '' (codes) to text value in where condition.
    output which i got is :
    select * from monitoring_table where study = fty777;
    but
    i need output like
    select * from monitoring_table where study = 'fty777';
    fty777 value should be in codes like 'fty777'. i read some articles but didnt get this example.
    please help.

    Try this:
    CREATE MATERIALIZED VIEW main
    REFRESH FORCE ON DEMAND
    AS
    SELECT
    a.table_name,
    a.column_name,
    b.trial_name,
    'select * from '||a.table_name||' where '||a.column_name|| ' = '''|| b.trial_name||'';'' "QUERY"
    FROM
    exp_csv_tb a,
    exp_csv_tr b;
    You have to give double single codes for semi-colons ..
    Regards..

  • How to select data from a table using a date field in the where condition?

    How to select data from a table using a date field in the where condition?
    For eg:
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
                                                      and bdatu = '31129999'.
    thanks.

    Hi Ramesh,
    Specify the date format as YYYYMMDD in where condition.
    Dates are internally stored in SAP as YYYYMMDD only.
    Change your date format in WHERE condition as follows.
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
    and bdatu = <b>'99991231'.</b>
    I doubt check your data base table EQUK on this date for the existince of data.
    Otherwise, just change the conidition on BDATU like below to see all entries prior to this date.
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
    and <b> bdatu <= '99991231'.</b>
    Thanks,
    Vinay
    Thanks,
    Vinay

  • How to use "where" condition when we use update or delete in a dbadapter?

    Hi
    I want to update/delete a record in a database table based on one of its fields. Which means I have to use "where" condition to check the value of the field and only then I can decide whether or not the record can be updated/deleted.
    When I try to use the dbadapter update/delete options, I dont see any provision for writing the "where" condition.(May be I am missing something).
    I know that I can use the custom sql option and write an sql command to achieve this.
    But I would like to know if this can be done when using the update/delete option itself in the dbadapter.
    Thanks in anticipation.
    Ravi

    Hi,
    You can use the logical delete option. In that case you can supply a value for the column that indicates if a record is changed and have it picked up by the db adapter.
    Andre

  • How to use wildcards in ABAP query where condition?

    Hi,
    Please tell me how to use wildcards in ABAP qurey where condition.
    e.g. select * from mara where matnr = * (wildcard we need to use.
    Thanks & Regards,
    Gaurav T

    Do you want to query asterix * ?
    select * from mara where matnr = '*'.  "then just put it in apstrophes
    or you want certain part of string be used as * ?
    select * from mara where matnr like '%*'  "then use % sign before it
    or maybe you want something like this
    select * from mara where matnr like '%1' . "then it will look for all materials having '1' inside it
    Regards
    Marcin

  • Where condition for reading infotype while using ldb

    hi
    i want to read info from infotype p0000
    using where condition eg: for pernr = ' '.
    i am using LDB pnp.
    how can i put the where condition while using macro
    rp-provide-from-last.
    regards
    cs

    in fact you don't have to get the values, you only need to tell to the program to take them into account :
    GET PRPS.
      CHECK SELECT-OPTIONS.

  • Using where condition with dynamic internal table

    Hi Friends.
    How to use where condition with dynamic internal table ?
    Regards,
    Amit Raut

    Hai Amit
    REPORT  ZDYNAMIC_SELECT                         .
    TABLES: VBAK.
    DATA: CONDITION TYPE STRING.
    DATA: BEGIN OF ITAB OCCURS 0,
    VBELN LIKE VBAK-VBELN,
    POSNR LIKE VBAP-POSNR,
    END OF ITAB.
    SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN.
    CONCATENATE 'VBELN' 'IN' 'S_VBELN.'
    INTO CONDITION SEPARATED BY SPACE.
    SELECT VBELN POSNR FROM VBAP INTO TABLE ITAB
    WHERE (CONDITION).
    LOOP AT ITAB.
    WRITE 'hello'.
    ENDLOOP.
    Thanks & Regards
    Sreenivasulu P

Maybe you are looking for