Multiple relationships between 2 tables in report model

if i have 2 relationships between the same two tables. how do i use one over the other?
for example, i have 2 tables order and ordeDate table , with the definition of:
order table:
orderid int,
qty int,
orderdate date)
and orderDate table:
(id int,
endOfDay date,
endOfMonth date)
i created one relation ship as orderDate = endOfDay and anothe relationship as orderDate = endOfMonth. some of my reports would need to use the relationship between orderDate = endOfDay and the month end reports would need to use yhe relationship between
orderDate = endOfMonth. How do I select one relationship over the other when building the report?
Ideally the database should have been redesigned, which cannot be done at the moment as this will be done on the next project

Your table design is completly wrong. I am now sure how you are maintaining OrderDate table. SQL Server is RDBMS. Without relation how will you pick those rows from Order table whose order date is equal exactly equal to datefield in OrderDate table. The
only way is to derived endofDay and endofMonth in the select query directly. I understand endofMonth. But what is EndofDay ? And that too a date datatype ??
You can run the below query but it will not return specific order date from order table,
SELECT * FROM [ORDER] WHERE
CONVERT(CHAR(10),ORDERDATE,101) IN (SELECT CONVERT(CHAR(10),endOfDay,101) FROM ORDERDATE)
SELECT * FROM [ORDER] WHERE
CONVERT(CHAR(10),ORDERDATE,101) IN (SELECT CONVERT(CHAR(10),endOfMonth,101) FROM ORDERDATE)
Even if i JOIN the two table by orderdate and endofDay/endofMonth, we will not received specific orderDate. And this is becouse if your Order table contains multiple orderDate that are matching to either endofDay or endofMonth, the final output will contain
multiple orderDate details. I don't think this is what you need. Therefore you need to modify the OrderDate table or provide us the definition for endofDay and endofMonth, and how are you maintaining.
Regards, RSingh

Similar Messages

  • Relationship between tables in a module(urgent)

    Hi ,
    Am new to this domain(SAP)...
    I want to move datas to SAP through codes...
    For example,i want to add datas to ItemGroups module of Inventory module....But it failed...On the other hand,i was able to add datas to Item table of the same module...
    i think there is someother table to which ItemGroups is related..Could anyone kindly help me in finding out these type of relationship between tables in a moduel at ease?
    Hoping for your quick reply,
    Thanks

    hi
    I think in your scnario data is fetching from material valuation table based on material number (MBEW-MATNR), through document segment material table (MSEG-MATNR).
    Based on you company material management flow, your scenario is based.
    hope this helps
    thank you.

  • TRACING RELATIONSHIP BETWEEN TABLES....

    Hello all,
    I use the below query to find the hierarchial relationship between tables ...
    SELECT
    c.table_name parent_table , c.column_name parent_column,b.table_name child_table ,b.column_name child_COLUMN ,LEVEL lrv
    FROM USER_constraints a,user_cons_columns b ,user_cons_columns c
    WHERE a.constraint_name = b.constraint_name
    AND a.r_constraint_name = c.constraint_name
    AND constraint_type = 'R'
    AND b.table_name <> 'CNTRCT_PARENT'
    START WITH b.table_name = 'CNTRCT_PARENT'
    CONNECT BY NOCYCLE PRIOR b.table_name = c.table_name
    ORDER BY c.table_name
    but i need order like below,
    parent table childtable1
    childtable1 grantchildtable1
    childtable1 grantchildtable2
    parent table childtable2
    childtable2 grantchildtable1
    childtable2 grantchildtable2
    childtable2 grantchildtable3
    how this sort of order by is possible ...
    Thanks in advance
    Vijay G

    Hi,
    Try
    ORDER SIBLINGS BY ...

  • Query to find all relationships between tables

    Please help me wit the following
    Query to find all relationships between tables
    SAMPLE OUTPUT:
    PRIMTAB PRIMCOL FOREIGNTAB FOREIGN KEY
    DEPT DEPTNO EMP DEPTNO
    Return all records in the database.
    PLEASE HELP

    SET LINESIZE 150
    COLUMN primcol FORMAT A30
    COLUMN foreigncol FORMAT A30
    SELECT uc1.table_name AS primtab,
    ucc1.column_name AS primcol,
    uc2.table_name AS foreigntab,
    ucc2.column_name AS foreigncol
    FROM user_constraints uc1,
    user_constraints uc2,
    user_cons_columns ucc1,
    user_cons_columns ucc2
    WHERE uc1.constraint_name = uc2.r_constraint_name
    AND uc1.constraint_name = ucc1.constraint_name
    AND uc2.constraint_name = ucc2.constraint_name
    AND ucc1.position = ucc2.position
    ORDER BY uc1.table_name,
    ucc1.position
    /

  • Relationship between  table (bsad,bsid) to faglflexa table

    Hi Gurus,
    this is very urgent,
    I am developing report for profit centre collections.
    how i establish relationship between bsad or bsid to faglflexa.
    faglflexa having docnr, docln and belnr,buzei in these doccument numbers which i will consider(docnr or belnr) to build relationship between bsad to faglflexa.
    if any one know  please send me the answer
    Regrds,
    Shashikumar.G
    Message was edited by:
    Shashikumar Guntuka
    Message was edited by:
            Shashikumar Guntuka

    Hi one of the options to consider to avoid multiple lines in FAGLFLEXA against one customer open item is to activate Document split by Profit Center, in the new GL
    With document split documents in FAGLFLEXA will be like:
    Customer 300
    Rev PC -300
    Customer 200
    Rev PC2 -200
    Instead of the standard one, that are causing your issue:
    Customer +500
    Rev PC1 -300
    Rev PC2 -200
    hope it helps

  • Relationship between table

    hi,
    iam having two tables BVOS, MODELS
    how to know the relationship between this two tables

    user9093689 wrote:
    sry dude
    i can find the ddl for those tables but i cannot find any foriegn key relationship.Then you're off to the races with option 2 i told you about before.
    Ask someone who works where you do. If no one implemented tables with foreign keys, the guessing game begins. Have fun.

  • ONE-to-MANY relationship between tables and forms in APEX

    I recently started using APEX and I have run into an issue.
    I have a ONE-TO-MANY relationship between two tables, A1 and A2, respectively.
    A1:
    A1_ID
    Item
    A2:
    A2_ID
    SubItem
    A1_ID
    I have 2 forms (lets call it F1 and F2) that I use to capture data for A1 and A2.
    On F2, I have the following fields that are setup to capture data:
         A2.A1_ID
    **A1.Item (this is a drop down that is populated using a SELECT statement where the select uses A1.Item field)
         A2.SubItem (user would enter SubItem)
    Note: A2.A2_ID is populated using a SEQ
    Everytime I pick **A1.Item on F2, is there a way to link to A1 table and display A1.A1_ID for every **A1.Item selected on F2?
    If so, I want to store the value captured in F2 for the A1_ID field into A2 table to maintain my 1-to-MANY relationship.
    If this will work, how do I go about implementing this solution?
    Can someone help me?

    I think it sounds like you are asking for a Master-Detail form. Try that and see what you get.
    chris.

  • How to easily find all the relationship between group and reports in OBIEE

    Hi, All:
    I am working with a production env which contains many group and reports.
    I want to know if there is a quick way to export the relationship between all the group/users and all the reports/page/etc.
    Thank you for the kind help.

    Thanks so much !
    May be you can suggest a way around what I trying to achieve. I migrated(imported) one BA from our Prod system to an R12 VIS demo system into the pre-existing APPS EUL as owner SYSADMIN. When I login as SYSADMIN I see all the workbooks(the ones that were migrated from PROD and the ones shipped with VIS). I am interested only in the Workbooks that I migrated from Prod System. There are 100's of migrated workbooks. I was thinking of creating another APPS user and grant this newly created user ADMIN privileges on the migrated BA and transfer ownership of all migrated WORKBOOK. This way when I login as the newly created user I will only see the migrated Workbooks. How do I automate the process to seperate them using SQL or otherwise
    Thanks
    Bismi

  • Relationship between tables while using inner joins.

    Hi,
    I had a few clarifications on "inner joins", and as i was going through the forum, i came across two points,
    1. In one of the threads it said " inner joins is applicable for tables that have a parent child relationship.
    2. In another thread it said " inner join is established from master table (the table on the left) to the transcation table (the table on the right)".
    I have two clarifications based on the above points.
    1. Is it necessary that the tables on which im performing an inner join should have a parent-child/children relationship or is it enough that the tables just have a common field.
    2.  Also is it necessary that the master table should come first, (or can i use any child table from where i can fetch the records when there is a mater table in my report) as shown below.
    Eg: select * <fields> from <master table> inner join <table> on <field> into <itab>.
    Edited by: Narayananchandran on Dec 27, 2010 12:31 PM

    have two clarifications based on the above points.
    1. Is it necessary that the tables on which im performing an inner join should have a parent-child/children relationship or is it enough that the tables just have a common field.
    2. Also is it necessary that the master table should come first, (or can i use any child table from where i can fetch the records when there is a mater table in my report) as shown below.
    Eg: select * <fields> from <master table> inner join <table> on <field> into <itab>
    1) NO
                      2) NO

  • Relationship between tables

    HI all;
    I need to get the following fields into my ODS.
    1. cost center
    2. activity type
    3. version
    5. Fiscal year
    6. Posting Period
    7. Activity Qty1
    8. Activity Qty2
    9 Activity Qty12.
    I see these fields are stored in the following table
    1. CSKS
    2. COSL
    3. CSLA
    when I created a view there is no relationship exits between these tables. Please guide me through how to create the relationship if I have to include another table which is the appropriate one for my scenario.
    thank you.

    Hi,
    you also need to take into account the table cssl. This is the link between cost centers and activity types, so between csks and csla. Now have a look into the content of table cosl. I guess the objnr contains costcenter and activity type concatenated together with some other information, --> KL<co_area><cost_center><activity_type>.
    regards
    Siggi

  • Relationship Between tables in ECC

    Hi Experts,
           I have to generate one report which is belongs to Purchasing, Meterial and Delivery. I need to findout the relation between  MSEG and MBEW, these two tables are belongs to Meterial.
        I found MATNR in both the tables but I found mamy records for MSEG-MATNR in MBEW-MATNR. I couldn't find on which basis they are posting the data into two tables.
        So what is the relation between these two tables. And let me know the relation between PURCHASING, METETIAL AND DELIVERY.
    Please can anyone give the complete details.
    Thank you,
    VCREDDY.

    hi
    I think in your scnario data is fetching from material valuation table based on material number (MBEW-MATNR), through document segment material table (MSEG-MATNR).
    Based on you company material management flow, your scenario is based.
    hope this helps
    thank you.

  • Relationship between Table BKPF and RBKP

    Hello Developers,
    I need to fetch value of field BKTXT  from table BKPF and this value need to insert in internal table i_tab.
    in the below situation:
    select bebeln bebelp bwerks ausnam alifnr abelnr
             abldat abudat
             caedat cekgrp cbukrs cekorg
             dbanfn dbnfpo dnetpr dafnam
      into corresponding fields of table i_tab
      from rbkp as a join rseg as b on abelnr = bbelnr
                     join ekko as c on bebeln = cebeln
                     join ekpo as d on cebeln = debeln
                                          and bebelp = debelp
      where a~budat in s_date
        and b~werks in s_werks
        and c~bstyp = c_f
        and c~ekorg in s_ekorg
        and a~bukrs in s_bukrs.
    Can any one suggest how to relate table BKPF with other table like RBKP.
    Thanks in advance.
    Regards
    Sundeep

    Hi,
    perform the following steps:-
    1.   Go to transaction SQVI
    2.   Create a View
    3.   Enter title
    4.   Choose the Data source as Table Join
    5.   Go to insert table and add table as per your requirement.
    and hereafter you can find relation between any two tables...
    Rgds/Abhi

  • Relationship between tables..Please.

    Hi SRM folks,
      I am working on EBD-SAP BW project, I have problem of primary key please look at my scenario.
    I have a view( ZBW_SHOPCART : View for extracting Shopping Cart data to BW),
    in turn the view is built on the following tables:
    1)  CRMD_ORDERADM_H : Business Transactions CRM                                                       
    2)  CRMD_ORDERADM_I  : Business Transaction Item                                                      
    3)  BBP_PDBEI  :  Backend Specific Item Data                                                                  
    4)  CRM_JEST   :  Individual Status per Object
    common primary key is GUID and MANDT
    According to the current  Requirements 
    We need to Enhance the view ZBW_SHOPCART  with the following table fields
    Step Name : Table   SWWWIHEAD : Workflow Runtime: Header Table for All Work Item Types
                              Field     WI_TEXT
    Status          :   Table   SWWWIHEAD
                              Field    WI STAT
    Results       : Table SWDSTEXT : Workflow definition: Language-dependent texts
                           Field WFD_TEXT
    Date            :   Table   SWWWIHEAD
                             Field    WI_CD
    Time          : Table   SWWWIHEAD
                          Field   WI_CT
    Agent       :   Table   SWWWIHEAD
                         Field   WI_AAGENT
    Problem :  There is no common( Primary key ) key between the tables SWWWIHEAD,  SWDSTEXT and the View ZBW_SHOPCART to join the tables with the View.
    Folks please suggest me in this regard, are there any ways to join the tables SWWWIHEAD and  SWDSTEXT with the view
    I will wait for your valuable suggestion,
    thank you
    DJ

    Hi,
    Currently we are extracting the data from EBP to SAP BW based on the view
    <b>ZBW_SHOPCART : View for extracting Shopping Cart data to BW</b>
    is containing the tables & fields as follows
    Tables:
            CRMD_ORDERADM_H
            CRMD_ORDERADM_I
             BBP_PDBEI
             CRM_JEST
    Field                Table
    CLIENT              -CRMD_ORDERADM_H
    HEADER_GUID      -CRMD_ORDERADM_H
    OBJECT_ID      -CRMD_ORDERADM_H
    ITEM_GUID      -CRMD_ORDERADM_I
    STAT              -CRM_JEST
    INACT              -CRM_JEST
    CHGNR              -CRM_JEST
    DESCRIPTION      -CRMD_ORDERADM_H
    CREATED_AT      -CRMD_ORDERADM_H
    BE_OBJECT_ID      -BBP_PDBEI
    CHANGED_AT      -CRMD_ORDERADM_H
    now Current requirement is to enhance that view with some more fields as follows
    Step Name : Table   SWWWIHEAD : Workflow Runtime: Header Table for All Work Item Types
                              Field     WI_TEXT
    Status          :   Table   SWWWIHEAD
                              Field    WI STAT
    Results       : Table SWDSTEXT : Workflow definition: Language-dependent texts
                           Field WFD_TEXT
    Date            :   Table   SWWWIHEAD
                             Field    WI_CD
    Time          : Table   SWWWIHEAD
                          Field   WI_CT
    Agent       :   Table   SWWWIHEAD
                         Field   WI_AAGENT
    I need to join this fields into the view, am not able to see the common( Primary key ) key.
    Please help me
    Message was edited by:
            Jangareddy dasari
    Message was edited by:
            Jangareddy dasari
    Message was edited by:
            Jangareddy dasari

  • Missing in relationship between employee and organizational model

    HI experts !
    I have a problem when creating organizational model.
    When I have created organizational (BP 2), I assigned some employee to that organization. But When I display organization ( BP 2)  by T code BP, no relationship " has the employee" was created.
    Please help me.
    Thanks in advance.

    Hi,
    Your Org is in which BP Role?
    Because if your BP is in X Role then to view the Relationship you need to choose the X Role in the BP ROLE FIELD (which is by default BP General when you Display the org).
    Or to confirm your relationship setting you can validate the existance by checking your EMLPOYEE BP.
    Hope this is helpful.
    VS

  • How to find the relationship between tables

    Hi All
    I am working in oracle apps R12 in OM and INV and i am new. Is there any document for getting the all key tables and the relationship of the tables.
    Thanks & Regards
    Srikkanth.M

    Hi;
    You need to check e-trm site to can see table explaniation,integrity,relations etc
    Check:
    etrm.oracle.com
    Regard
    Helios

Maybe you are looking for

  • In order to create a web service on SAP R/3 what are the prerequisites.

    Hi All I want to create a web service(for a bapi) on SAP R/3  which will be used by a third party application. I dont know anything about creating a web service. My question is <b>in order to create a web service do we need to run Sap R/3 on netweave

  • How do i watch tv shows after i purchase them, i can only view 30 second videos

    how do i watch tv shows after i purchase them on itunes, i can only view 30 second video?

  • Mac Air using projector problem

    MacBook air mid 2012 11 inch. Trying to use with older InFocus projector, which works fine with my iBook. Using new mini display-VGA cable. Projector searches for computer and finds it, but displays galaxy picture that is unfamiliar. When open Displa

  • Idoc views updation, Workflow, Performance tuning techniques!

    Hello, Greetings for the Day! Currently my client is facing following issues and they seek an help/attention to these issues. Following is the current landscape of an client. Sector – Mining SAP NW MDM 7.1 SP 09 SAP ECC EHP 5 SAP PI 7.0 List of Issue

  • Customizing non-Oracle datatypes

    Here's a challenge. I've successfully set up Heterogenous Data Services for a SQL Server database. The Business area is successfully created. In the SQL Server database, there are bit fields we use. We want the value of the bit field, which is a 1 or