Analytic View join issue between TIMESTAMP and DATE formats

I have a fact table in my data foundation that has a TIMESTAMP date that i am trying to join with to my calendar table that has  a DATE format .  I am unable to query this view after creating it and it appears to be because of the data type differences.  Is there a way to convert when joining? i can not seem to find a way to do this

Yes, you can use a generated always statement to create a join predicate and join against that in the view.
Or you can join against the M_TIME_DIMENSION table in an attribute view to convert.
Or you can create a calculated column and do a union.
Depending on the requirements, one of these will be the best fit.

Similar Messages

  • Select where timestamp between date1 and date 2

    try a lot of variations but still dont work
    this was my last shot, then i come here ask for help
    the field DATAHORAS is timestamp
    data1 and dat2 will come from a form
    To_Date(S.DATAHORAS, 'dd/mm/yyyy hh24:mi:ss')
    Between Cast(To_Date(:data1) As TimeStamp) And Cast(To_Date(:data2) As TimeStamp)
    thanks in advanced

    No. You don't need to. But....
    Edit: I was originally using a stupid example using DUAL which was completely misleading - sorry.
    Originally I used the example below to show that you don't have to do an explicit conversion.
    Things will still work comparing timestamps and dates.
    SQL> select systimestamp, sysdate, sysdate+1
      2  from dual
      3  where systimestamp between sysdate and sysdate + 1;
    SYSTIMESTAMP                        SYSDATE              SYSDATE+1
    09-FEB-10 13.58.35.712017 +00:00    09-FEB-2010 13:58:35 10-FEB-2010 13:58:35But then I added an explain plan to show that implicit conversions were going on:
    1  explain plan for
      2  select systimestamp, sysdate, sysdate+1
      3  from dual
      4* where systimestamp between sysdate and sysdate + 1
    SQL> /
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 4192335797
    | Id  | Operation        | Name              | Rows  | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT |                   |     1 |     1   (0)| 00:00:01 |
    |*  1 |  FILTER          |                   |       |            |          |
    |   2 |   INDEX FULL SCAN| SYS_IOT_TOP_57625 |     1 |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
       1 - filter(SYS_EXTRACT_UTC(SYSTIMESTAMP(6))<=SYS_EXTRACT_UTC(SYSDATE@
                  !+1) AND SYS_EXTRACT_UTC(SYSTIMESTAMP(6))>=SYS_EXTRACT_UTC(SYSDATE@!))
    15 rows selected.
    SQL>However, this example is misleading because it's not the same implicit conversion you get with a proper table with a timestamp column:
    SQL> create table t1
      2  (col1 timestamp);
    Table created.
    SQL> ed
    Wrote file afiedt.buf
      1   explain plan
      2   for
      3   select *
      4   from   t1
      5   where col1 between to_date('08-JAN-2010','DD-MON-YYYY')
      6*             and     to_date('09-JAN-2010','DD-MON-YYYY')
    SQL> /
    Explained.
    SQL>
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 3617692013
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |     1 |    13 |     2   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| T1   |     1 |    13 |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
       1 - filter("COL1">=TIMESTAMP' 2010-01-08 00:00:00' AND
                  "COL1"<=TIMESTAMP' 2010-01-09 00:00:00')
    Note
       - dynamic sampling used for this statement
    18 rows selected.
    SQL>Which is really what you want.
    It has an implicit conversion on the date parameters and no implicit conversion on the column which would prevent index usage if there were an index.
    Interestingly if you explicitly convert the dates to a timestamp, then you can get an extra filter predicate comparing the two parameters:
    SQL> explain plan
      2  for
      3  select *
      4  from   t1
      5  where col1 between cast(to_date('08-JAN-2010','DD-MON-YYYY') as timestamp)
      6             and     cast(to_date('09-JAN-2010','DD-MON-YYYY') as timestamp);
    Explained.
    SQL>
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 3332582666
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |     1 |    13 |     2   (0)| 00:00:01 |
    |*  1 |  FILTER            |      |       |       |            |          |
    |*  2 |   TABLE ACCESS FULL| T1   |     1 |    13 |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
       1 - filter(CAST(TO_DATE(' 2010-01-08 00:00:00', 'syyyy-mm-dd
                  hh24:mi:ss') AS timestamp)<=CAST(TO_DATE(' 2010-01-09 00:00:00',
                  'syyyy-mm-dd hh24:mi:ss') AS timestamp))
       2 - filter("COL1">=CAST(TO_DATE(' 2010-01-08 00:00:00', 'syyyy-mm-dd
                  hh24:mi:ss') AS timestamp) AND "COL1"<=CAST(TO_DATE(' 2010-01-09
                  00:00:00', 'syyyy-mm-dd hh24:mi:ss') AS timestamp))
    Note
    PLAN_TABLE_OUTPUT
       - dynamic sampling used for this statement
    23 rows selected.oracle version 11.1.0.6
    Sorry about the mistakes in previous version of this reply.
    Edited by: DomBrooks on Feb 9, 2010 2:25 PM

  • Join condition between PO_REQUISITION_HEADERS_ALL and WF_NOTIFICATIONS

    Hi,
    Could anyone tell me what is the join condition between PO_REQUISITION_HEADERS_ALL and WF_NOTIFICATIONS?
    I joined these two tables by WF_NOTIFICATIONS.ITEM_KEY = PO_REQUISITION_HEADERS_ALL .WF_ITEM_KEY.But I cannot found some approved requisitions item key in WF_NOTIFICATIONS table.
    Please help.
    I paste my query below:
    SELECT PRH.ORG_ID ORG_ID,
    WF.ITEM_KEY,
    WF.FROM_ROLE,
    PRH.WF_ITEM_KEY,
    WF.RECIPIENT_ROLE APPROVERS_NAME,
    TRUNC(NVL(PRH.APPROVED_DATE, '')) DATE_APPROVED,
    WF.SUBJECT SUBJECT,
    PRH.DESCRIPTION REQ_DESC,
    PRH.SEGMENT1,
    (SUM(NVL(PRL.AMOUNT, 0)) +
    SUM(NVL(PRL.UNIT_PRICE, 0) * NVL(PRL.QUANTITY, 0))) REQ_AMT,
    GL.SEGMENT1 || '.' || GL.SEGMENT2 || '.' || GL.SEGMENT3 || '.' ||
    GL.SEGMENT4 || '.' || GL.SEGMENT5 || '.' || GL.SEGMENT6 || '.' ||
    GL.SEGMENT7 || '.' || GL.SEGMENT8 CHARGE_ACCT
    FROM APPS.WF_NOTIFICATIONS WF,
    APPS.PO_REQUISITION_HEADERS_ALL PRH,
    APPS.PO_REQUISITION_LINES_ALL PRL,
    APPS.PO_REQ_DISTRIBUTIONS_ALL PRD,
    APPS.GL_CODE_COMBINATIONS GL
    WHERE WF.FROM_ROLE IN ('GHAWKINS', 'GHALVERSON', 'NCERNOTTA', 'DCOLLOPY', 'RHAY')
    AND BEGIN_DATE > SYSDATE - 60
    AND WF.MESSAGE_TYPE = 'REQAPPRV'
    AND WF.ITEM_KEY = PRH.WF_ITEM_KEY --added
    AND PRH.AUTHORIZATION_STATUS = 'APPROVED'
    AND PRL.REQUISITION_HEADER_ID = PRH.REQUISITION_HEADER_ID
    AND PRD.REQUISITION_LINE_ID = PRL.REQUISITION_LINE_ID
    AND PRD.CODE_COMBINATION_ID = GL.CODE_COMBINATION_ID
    GROUP BY PRH.ORG_ID,
    WF.ITEM_KEY,
    WF.FROM_ROLE,
    PRH.WF_ITEM_KEY,
    WF.BEGIN_DATE,
    WF.SUBJECT,
    WF.RECIPIENT_ROLE,
    PRH.APPROVED_DATE,
    PRH.DESCRIPTION,
    PRH.SEGMENT1,
    PRL.REQUISITION_HEADER_ID,
    GL.SEGMENT1 || '.' || GL.SEGMENT2 || '.' || GL.SEGMENT3 || '.' ||
    GL.SEGMENT4 || '.' || GL.SEGMENT5 || '.' || GL.SEGMENT6 || '.' ||
    GL.SEGMENT7 || '.' || GL.SEGMENT8

    Pl see if these MOS Docs can help -
    603232.1 - How to Diagnose Purchasing Document Approval Routing
    579522.1 - Forward Document Form FAQ
    431767.1 - How To View Requisition From The Email Notifications For Which Workflow Data Is Purged
    HTH
    Srini

  • What is the difference between olap and data warehouse..?

    Hi All,
    Is their any difference between olap and data warehouse..? Please let me know your knowledge about these. Thank you..
    ------------------------------------------------------------------------ Please mark it as complete, if you get the solution with this reply. TQ.

    A data warehouse is a database containing data that usually represents the business history of an organization. This historical data is used for analysis. Data in a data warehouse is organized to support analysis rather than to process real-time transactions
    as in online transaction processing systems (OLTP).
    OLAP technology enables data warehouses to be used effectively for online analysis, providing rapid responses to iterative complex analytical queries. OLAP's multidimensional data model and data aggregation techniques organize and summarize large amounts
    of data so it can be evaluated quickly using online analysis and graphical tools.
    Reference:
    http://technet.microsoft.com/en-us/library/aa197903(v=sql.80).aspx
    http://stackoverflow.com/questions/18916682/data-warehouse-vs-olap-cube
    If this post answers your query, please click "Mark As Answer" or "Vote as Helpful".

  • Why can't I use WebCT chat with my computer?  I get the 'spiral of death' every time I try to type in my chat.  I have a feeling it has to do with compatibility issues between Java and Tiger.

    Why can't I use WebCT chat with my computer?  I get the 'spiral of death' every time I try to type in my chat.  I have a feeling it has to do with compatibility issues between Java and Tiger.

    Hi Elizabeth,
    Do your Mac meet any of these requirements?
    http://www.wvnet.edu/services/webct/requirements.html
    From this it appears to be PC only!???
    http://sourceforge.net/projects/awebctcclient/files/Pancake%20%28it%20own%20proj ect%20now%29/Pancake%20Console%20V1.0.0/PancakeConsole-1.0.0-src.zip/download
    Can you provide any more info on which bersion or file you have?
    Can you tell us why you need this for your use?

  • SAP APO Link between pegid and date

    Hi all,
    It's exist a link between pegid and data (order's data)  ??
    Tks,
    bye.

    Please check FM in se37
    /SAPAPO/OM_PEGID_SELECT_ORDERS
    /SAPAPO/OM_PEGID_GET_ORDERS
    Manish

  • What is the Join condition between mtl_system_items_b and mtl_onhand_quantities_detail

    Hi,
    What is the Join condition between mtl_system_items_b and mtl_onhand_quantities_detail?
    Thanks & Regards,
    Hari Babu

    Please see the query in (Consolidate Onhand Quantity /Sum Quantity Zero in MTL_ONHAND_QUANTITIES_DETAIL (MOQD) / Concurrent Program Consolidate Inventory Onhand Quantities / Datafix for 0 Quantity Displayed For Finished Goods (Doc ID 353345.1)), is shows how to join those 2 tables.
    http://etrm.oracle.com
    Thanks,
    Hussein

  • Default view and date format for anonymous access in convergence calendar

    Hi,
    is there an option to configure default view and date format when user access to a calendar with anonymous access ?
    Actually, date format is M/D and I want D/M.
    And the default view is monthly, and I would like to set to 7 days view.
    Thx for your help
    Regars,
    JC

    jchatriot wrote:
    is there an option to configure default view and date format when user access to a calendar with anonymous access ?No. I've raise a new Request For Enhancement:
    RFE #6961895 - "Provide configuration option and URL parameter to set Anonymous Calendar view and date format"
    Regards,
    Shane.

  • Compatibility issues between R12 and report builder 2.5

    Hi,
    I just want to know if there are issues between R12 and (Forms 4.5 and Reports 2.5)? I have been using 6i since I started in the oracle so I'm a little new to this.
    Thanks
    peopsquik

    As my understanding there is no issue for Forms 4.5 and Reports 2.5 with R12.
    You can develop report with Report 6i can be deployed with R12.You cannot use Forms 4.5, Reports 2.5 or Developer (Forms/Reports) 6i with Oracle EBs R12 as it is not certified. The only supported version is Developer 10g
    Using the OracleAS 10.1.2 Forms and Reports Builders with Oracle Applications Release 12 [ID 444248.1]
    Thanks,
    Hussein

  • Link Between PSA and Data Targets

    Hi Experts,
    Could you please help me is there any table which will have PSA & data target (Cube or ODS) details.
    I know the table which will have data target manage screen details and other table wil give the details like data loaded into till PSA.
    But i want to know any SAP table will have link between PSA & data target.
    I want to know if the request is loaded till PSA or it is loaded into data target.
    Any table will give details like PSA request no, if target is there then some kind of flag like....
    Please let me know if any one know the table which will have PSA as well as Data target details.
    Thaks in Advance
    Shaik

    Hi,
    I clearly mentioned im aware of Manage screen details table, i want link between PSA and Data target table which will return if requst loaded till PSA or PSA & target.
    Im using BI 7.0 .
    Regards
    Shaik

  • In the advanced tab of languages and Region the time and date formats will not change

    For a certian Application I am using I need to change the format of the Time and Date. I had no problems in Mountain Lion. In the advanced tab of languages and Region the time and date formats will not change. I need the date format to read as 01/01/14 and time format to read 13:00. As I said this was easily done in Mountain Lion and all previous Apple OS. I suspect it's an issue with in the OS.

    You're right, it has been that way for a long time. I've never bothered reporting it as a bug since it's simple enough to deal with, but reporting it would be a reasonable thing to do.

  • BestPractices Error - Set Decimal Notation and Date Format

    Hello everyone,
    first of all, I don't know, if this is the right forum for my question, but I hope so
    We're trying to implement the Best Practices Scenarios to a new SAP ERP System.
    We did the steps of the following url, where everything worked fine: http://help.sap.com/bp_dm603/DM_DE/html/index_DE.htm
    Then we integrated Best Practices 603V8 via Solution Builder (TA: /n/SMB/BBI). But now, when we switch to Implementation Assistant and try to activate Scenario DE_109 --> 100(DE) --> Folder USERSETTINGS, we receive the following error in report /SMB99/SU3_O009_B32: Set Decimal Notation and Date Format.
    So we called transaction SU3 and changed Decimal Notation and Date Format, but the error still exists.
    Anybody knows what to do?
    Thanks for your help!
    Best regards
    Patrick
    PS: We executed Testscript /SMB99/SU3_C009_B32 via TA SECATT and there is the error:
    TCD SU3 0,292 sec N Maintain Users Own Data

    Hi,
    Follow below link to verify whatever you have done is correct:
    http://help.sap.com/bp_bblibrary/600/Documentation/B32_BB_ConfigGuide_EN_MX.doc.
    Thanks
    Sunny

  • List all of the existing column and there column format and data format?

    Hello Gurus,
    I am new to OBIEE and i have a requirement to verify the column format and data format for all of the existing column while generating a analysis report. Is there any way i can list down all of the columns which are exposed and list there column format and data format?
    For checking the individual column properties i know there is an option called 'Column Properties' but want to know all in once go.
    Kindly help me and thanks in advance.
    Thanks

    I don't think you have anything in answers to get that, Go to Repository and Utilities -> Generate Metadata Dictionary that will give columns and datatype.
    Award points if it helps
    ~Srix

  • List of Number format and Date format according to the Locales

    Hallo everyone.
    I am searching for a list or document which includes the number and date formats according to the country locales. Where can I find sort of document?
    Another question: Where can I find the all parameters of swing.properties file?

    "Date - allows the user to enter a date as a parameter. Note that the data type must also be "Date" and the format must be Java date format."
    Page 4-9, Adding Parameters and Lists of Values
    Oracle® Business Intelligence Publisher
    Report Designer's Guide
    Release 10.1.3.4
    Part No. E12187-01

  • Data type conversion issues between Oracle and SQL Server

    Hi there, I am using Heterogeneous Services to insert into a SQL Server database. I am running into an issue between data types regarding Oracle's VARCHAR2 and trying to insert that into a SQL Server MONEY data type. I tried using the TO_NUMBER() function to convert my VARCHAR2 to a number, but that didn't seem to help.
    Does anyone have any advice on how to work around this??
    Thanks for any help,
    ivalum21

    ORA-02047: cannot join the distributed transaction in progress
    ORA-06512: at "MY_PACKAGE_NAME", line 263
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Generic Connectivity Using ODBC]DRV_Execute: DB_ODBC_ENGINE (1645): ;
    [Microsoft][ODBC SQL Server Driver][SQL Server]Disallowed implicit conversion
    from data type varchar to data type money, table 'tableA',
    column 'total_amount'. Use the CONVERT function to run this query. (SQL
    State: 37000; SQL Code: 260)
    ORA-02063: preceding 2 lines from SQLSERVER_LINK
    ORA-06512: at "RCDTPUMP.CAMPUSCALL_DATAPUMP_UNI", line 875
    ORA-06512: at "RCDTPUMP.CAMPUSCALL_DATAPUMP_UNI", line 791
    ORA-06512: at "RCDTPUMP.CAMPUSCALL_DATAPUMP_UNI", line 1156
    ORA-06512: at line 1
    That is what I get when I take out the TO_NUMBER()
    Message was edited by:
    ivalum21

Maybe you are looking for