Help - Need to Get Max(Date) from An Unrelated Table in PowerPivot

I have two tables in my Power Pivot model:
Table A (a many table)
Asset    
SerialNumber                   
User
CTUT111                             
YC112233                                            
Bob
CTUT222                             
ZZ221144                                            
Susy
CTUT222                             
ZZ221144                                            
Larry
CTUT333                             
AB332244                                           
Bob
Table B (a many table, a CSV import from another system)
Asset                    
SerialNumber                                   
CheckIn_Date
CTUT111                             
YC112233                                            
6/15/2014
CTUT111                             
YC112233                                            
6/20/2014
CTUT222                             
ZZ221144                                            
6/18/2014
CTUT333                             
AB332244                                           
6/20/2014
I know it appears odd that Table B would have two entries for the same Asset (CTUT111), but it does.
I know I could write a SQL query that gave me the MAX(CheckIn_Date), but I’m not staging these datasets in a SQL server first. 
I’m pulling directly from CSV tables.
I don’t want to have bridge tables either, if possible. 
So, I’m left with a many-to-many situation in Power Pivot.
I want to add a Calculated Column to Table A, called ‘Latest CheckIn Date’ – which I get from Table B, matching on Serial Number.
So, when I’m done, I would expect the value for Asset=CTUT111 to be 6/20/2014 (since it’s the MAX of a value of dates)
I’m trying this pattern from Marco Russo in which you don’t need to relate two tables to exchange information, but it doesn’t appear to be working.
=CALCULATE (
MAX ( VALUES ( TableB[CheckIn_Date] ) ),
FILTER (
TableB,
'TableA'[SerialNumber]
= TableB[SerialNumber]
I’ve also tried to use LOOKUPVALUE, but I can’t seem to figure it out.
Would appreciate the help.
Thanks in advance.
-Eric

Hi Eric,
Please, try this one formula:
=CALCULATE (
            MAXX ( VALUES( TableB[CheckIn_Date] ); TableB[CheckIn_Date] );
            FILTER (
                TableB;
                'TableA'[SerialNumber] = TableB[SerialNumber]
P.S. In my locale I use ";". According to your locale you should use ",".
Truly yours,
Paul

Similar Messages

  • Help needed to get unique record from an internal table

    Hi Everybody,
    I have to get unique record from an internal table. i know we can use read statement with key condition .
    But the problem is i have to use some relational operators like GE or LE.
    eg
    read table itab into wa with key width GE itab-widthfrom
                                                       width LE itab-widthto
                                                       machno eq itab-machno.
    Its giving me error when I use the operators GE , LE.( I think since it can't find a unique record with those relational
    operators in the with key statement)
    Is there any other way to get unique record from internal table without using the loop?
    Thanks,
    Sunny

    Using the read statement you will need some kind of loop. For example.
    DO.
    READ TABLE......
      WITH KEY ......
                        READ = SPACE
    IF SY-SUBRC EQ 0
      TABLE-READ = 'X'.
      MODIFY TABLE
      ADD 1 TO W_FOUND.
    ELSE
      EXIT.
    ENDIF
    ENDDO.
    IF W_FOUND EQ 1.
    ...record is unique.
    ENDIF.

  • This may be a duplicate but, I have a new ipad mini that I need to activate but I need to get my data from my 1pad 1 which has never been backed up.  How do I get the data from the ipad 1 to the new mini?  I have itunes acct and also Icloud acct.  Thanks

    I have a new ipad mini that I need to activate but I need to get the data from my old ipad 1 and install on the new mini.  I have a itunes acct and also icloud acct.  How do I back up the ipad 1 data and then activate the mini.  I assume I will need to transfer the sim from the ipad 1 to the mini.
    Thanks for any info
    wino454

    How to Transfer Everything from an Old iPad to New iPad
    http://osxdaily.com/2012/03/16/transfer-old-ipad-to-new-ipad/
     Cheers, Tom

  • How to get the data from a cluster table to BW

    Dear All,
    I want to extract the data from R/3 to BW by using 2 tables and one Cluster B2.
    Actually my report contains some fields from PA2001, PA2002 and one cluster table B2 (Table ZES). Can I create View by using these 3 tables? If it is not possible how can I get the data from the cluster? Can I create generic datasource by using cluster tables directly?
    In SE11 Transaction the Cluster (table ZES) is showing invalid table.
    I referred some Forums, but no use.
    Can any body tell me procedure to get the data from a cluster (table ZES) ?
    Waiting for you results.
    Thanks and regards
    Rajesh

    HI Siggi,
    Thank you for your reply..
    I am also planning to do FM to get the data. But it is saying that the Cluster table ZES does not exist (ZES is the the standard table, in SE11 also).
    How can I use the Fields from the that table.?
    What can I do now, can you please explain me about this point.
    Waiting for your reply.
    Thanks and Regards
    Rajesh
    Message was edited by:
            rajesh

  • Can we get the data from two internal tables in ALV.

    hi friends i would like to display the data using two internal tables using alv grid.please guide me.

    Hi,
    ALV would be having a specific layout say :
    MATNR
    MAKTX
    QTY
    Now, if you have two internal tables, then do they have a different structure. If they have different structures, then what kind of ALV layout you expect. The ALV output should be as per the structure of 1st or 2nd internal table.
    If both internal table have same layout, then populate the data from 2nd internal table into 1st internal table and pass the 1st internal table ( it will have data of both internal tables) to ALV.
    Best regards,
    Prashant

  • Friend deleted app (my disk for iphone) and need to get back data from my icloud backup...need help!

         I had this app called my disk (app store name is: Lock photo+video safe - secure folder manager to protect private photos vault & hide secret picture file privacy) This app lets me have two passwords with different pictures and videos in each of them. It's a really great app.
         My friend deleted the app by "accident" and I need to get the app back with all my data. I have a backup of the app on my icloud backup that was taken place two months ago (around same time the app was deleted). It shows up in the cloud saying I have 4gb worth of that app in the cloud. I restore my phone back to that backup but the app data is not there. I wasn't sure if I had to wait till my iphone backs up everything (like music and pictures for example) for it to show up but as soon as the app downloaded I opened it hapilly knowing I have my data back but unfortunately it was not there. In the app itself, there's an option to backup from the cloud but it just brings up this window that says you can back up from the cloud (doesn't have a place to hit that says restore or anything).
         Is there something I am doing wrong? Can anyone help me? I really need that app data back because I have pictures of memories with friends and family inside that app that I do not have anywhere else. Once i get the back back ill be sure to save the photos onto my computer just incase anything goes wrong again.
    Thanks everyone for the help!
    Nikhil

    fwiw
    It seems that in a case like this you'd need to reset the device to factory settings and then restore from iCloud backup.
    Sadly the reset to factory settings could cause more trouble than its worth.
    Apple's iCloud backup, could, but does not let the user restore one app or its data.
    You'll also find that even though that App's data is in the cloud, you as its owner do not have access to it.
    Hope it helps/

  • Gurus...Need help....extract data from BKPF header table and BSEG line item

    Gurus,
    I have to write the logic to fetch data from bkpf and bseg. Need help on how can i do that..
    I have to get bukrs  belnr gjahr ldgrp from BKPF for a given date and company code. For all these documents, then i have to get the line items from BSEG if the ldgrp is I1 or SPACE.
    If the ldgrp is not I1 or SPACE then i have to fetch the records from BSEG_ADD and then generate a ALV report with all the data including the data that was fetched from BKPF.
    So, it wil be a combined ALV report that displays header as well as LINE item data together...
    Can u please help me with the code...I am not sure how can everything go all together in one internal table....Becoz once its there in one table then only a ALV list can be generated.......
    Cheers:
    Sam

    hi Sam, this may be of some similar thing.
    Use this program, I got this prog from a source and we added a small conditional check in the program which checks document numbers in BSEG and also comapres in BKPF and sees if the output from BSEG falls under the posting data range specified in the initial selection.
    Now just so you know, this output is kinda messed up, so you will have to play with it in Excel to extract the document numbers, if that is what you want.
    ============================
    PROGRAM....... ZFI_BSEG_DOWNLOAD
    TITLE......... Download BSEG
    PROGRAM TYPE.. Download
    ======================================================================
    GENERAL DOCUMENTATION AND COMMENTS
    <...>
    ======================================================================
    ASSOCIATED PROGRAMS
    <Program>..... <Description>
    ======================================================================
    CHANGE HISTORY
    Date By Ticket Description
    REPORT zfi_bseg_download.
    TABLES: bseg, bkpf.
    TYPES: BEGIN OF ty_output,
    line(6000) TYPE c,
    END OF ty_output.
    TYPES: ty_tab_output TYPE TABLE OF ty_output,
    ty_tab_nametab TYPE TABLE OF x031l.
    CONSTANTS: c_delimiter(04) TYPE c VALUE '"%%"',
    c_records TYPE i VALUE 10000.
    SELECTION-SCREEN
    SELECT-OPTIONS: p_bukrs FOR bseg-bukrs,
    p_belnr FOR bseg-belnr,
    p_buzei FOR bseg-buzei,
    p_gjahr FOR bseg-gjahr,
    p_budat for bkpf-budat.
    SELECTION-SCREEN SKIP.
    PARAMETERS: p_file LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN SKIP.
    PARAMETERS: p_append AS CHECKBOX DEFAULT 'X'.
    START-OF-SELECTION
    START-OF-SELECTION.
    PERFORM get_records.
    *& Form get_records
    FORM get_records.
    DATA: l_cursor TYPE cursor,
    lt_bseg TYPE TABLE OF bseg,
    ls_bseg LIKE LINE OF lt_bseg,
    lt_output TYPE ty_tab_output,
    ls_output LIKE LINE OF lt_output,
    lt_nametab TYPE ty_tab_nametab,
    ls_nametab LIKE LINE OF lt_nametab,
    l_field(30) TYPE c,
    l_output(50) TYPE c,
    l_date(10) TYPE c,
    l_len TYPE i.
    FIELD-SYMBOLS: <field>.
    IF p_append NE space.
    OPEN DATASET p_file FOR APPENDING IN TEXT MODE.
    ELSE.
    OPEN DATASET p_file FOR OUTPUT IN TEXT MODE.
    ENDIF.
    Retrieve BSEF fieldnames and data types
    PERFORM get_fields CHANGING lt_nametab.
    OPEN CURSOR l_cursor FOR
    SELECT * FROM bseg
    WHERE bukrs IN p_bukrs
    AND belnr IN p_belnr
    AND buzei IN p_buzei
    AND gjahr IN p_gjahr.
    Write out fieldnames
    IF p_append IS INITIAL.
    LOOP AT lt_nametab INTO ls_nametab.
    CONCATENATE ls_output ls_nametab-fieldname
    INTO ls_output SEPARATED BY c_delimiter.
    ENDLOOP.
    IF ls_output+0(4) = c_delimiter.
    SHIFT ls_output LEFT BY 4 PLACES.
    ENDIF.
    l_len = strlen( ls_output ).
    TRANSFER ls_output TO p_file LENGTH l_len.
    ENDIF.
    Process BSEG records
    DO.
    CLEAR lt_bseg.
    FETCH NEXT CURSOR l_cursor
    INTO TABLE lt_bseg
    PACKAGE SIZE c_records.
    IF sy-subrc 0.
    EXIT.
    ENDIF.
    LOOP AT lt_bseg INTO ls_bseg.
    SELECT single * FROM BKPF
    WHERE BUKRS = ls_bseg-BUKRS
    AND BELNR = ls_bseg-BELNR
    AND GJAHR = ls_bseg-GJAHR
    AND BUDAT in p_budat.
    if syst-subrc 0.
    continue.
    endif.
    CLEAR ls_output.
    Process individual fields of BSEG record
    LOOP AT lt_nametab INTO ls_nametab.
    CONCATENATE 'LS_BSEG-' ls_nametab-fieldname INTO l_field.
    ASSIGN (l_field) TO <field>.
    CLEAR l_output.
    Process by field data types
    CASE ls_nametab-exid.
    WHEN 'C' OR 'N' OR 'I'.
    Character, Numeric & Integer
    l_output = <field>.
    WHEN 'D'.
    Dates
    WRITE <field> TO l_date DD/MM/YYYY.
    l_output = l_date.
    WHEN 'P'.
    Packed decimals
    WRITE <field> TO l_output.
    WHEN OTHERS.
    MESSAGE a000(zs) WITH 'Data type error - ' ls_nametab-exid.
    ENDCASE.
    SHIFT l_output LEFT DELETING LEADING space.
    CONCATENATE ls_output l_output
    INTO ls_output SEPARATED BY c_delimiter.
    ENDLOOP.
    IF ls_output+0(4) = c_delimiter.
    SHIFT ls_output LEFT BY 4 PLACES.
    ENDIF.
    l_len = strlen( ls_output ).
    TRANSFER ls_output TO p_file LENGTH l_len.
    ENDLOOP.
    IF sy-subrc = 0.
    ENDIF.
    ENDDO.
    CLOSE CURSOR l_cursor.
    CLOSE DATASET p_file.
    ENDFORM. " get_records
    *& Form get_fields
    FORM get_fields CHANGING pt_nametab TYPE ty_tab_nametab.
    CALL FUNCTION 'RFC_GET_NAMETAB'
    EXPORTING
    tabname = 'BSEG'
    TABLES
    nametab = pt_nametab
    EXCEPTIONS
    table_not_active = 1
    OTHERS = 2.
    IF sy-subrc 0.
    ENDIF.
    ENDFORM. " get_fields
    hope this helps.
    cheers,
    Hema.

  • Need to extract the data from the CRM table : SCAPPTSEG

    Hi BW Experts,
    I want to extract the Data from CRM Table "SCAPPTSEG" to BW. The dates are stored in UTC Format.So for getting the date in CET format, we have used the Function Module "IB_CONVERT_FROM_TIMESTAMP".
    I want to create a datasource for extracting the data from "SCAPPTSEG" table and i need to use the function module for getting the date in CET Format.
    Can i achieve this action through Generic Extraction.
    please provide me the steps to achieve this.
    Thanks,
    Shahina.A

    not answered

  • Getting same data from two diffrent tables

    Select * from events where  job_dtls_id IN (select job_dtls_id from job_details where job_no='' and consignment_id='' and carrier_reference='');
    Hello All,
    I have to retrieve job_dtls_id (query in brckets ) in which it will match the above shown criteria (job_no,consignment_id and carrier_reference).
    but the problem is job_no And consignment_id are in one table and carrier_reference is in another.
    the two table have relation on job_dtls_id.
    Do anybody have an Idea please Help.
    Thanks.

    Hi Nilesh,
    As suggested by John, having JOIN on the tables should give you the desired output and have it saved as stored procedure and invoke it from BizTalk, have a look at following post for reference: http://tech-findings.blogspot.com/2013/08/polling-data-from-sql-using-wcf-sql.html
    Maheshkumar
    S Tiwari|User
    Page|Blog|How
    to Access an Orchestration variable in Map

  • How to get common datas from two int.tables

    hi,
    please tell me , how to i will get the common datas between two int. tables
    & place them in third int. table.
    give me syntax.
    regards
    subhasis.

    Hi Subhasis,
    <b>SORT :</b></u>
    SORT itab.
    Extras:
    1. ... BY f1 f2 ... fn
    2. ... ASCENDING
    3. ... DESCENDING
    4. ... AS TEXT
    5. ... STABLE
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Field symbols not allowed as sort criterion.
    Effect
    The entries in the internal table are sorted in ascending order using the key from the table definition (DATA, TYPES).
    Addition 1
    ... BY f1 f2 ... fn
    Effect
    Uses the sort key defined by the sub-fields f1, f2, ..., fn of the table itab instead of the table key. The fields can be of any type; even number fields and tables are allowed.
    You can also specify the sort fields dynamically in the form (name). If name is blank at runtime, the sort field is ignored. If itab is a table with a header line, you can also use a field symbol pointing to the header line of itab as a dynamic sort criterion. A field symbol that is not assigned is ignored. If a field symbol is assigned, but does not point to the header line of the internal table, a runtime error occurs.
    If the line type of the internal table contains object reference variables as components, or the entire line type is a reference variable, you can use the attributes of the object to which a reference is pointing in a line as sort criteria (see Attributes of Objects as the Key of an Internal Table.
    You can address the entire line of an internal table as the key using the pseudocomponent TABLE_LINE. This is particularly relevant for tables with a non-structured line type when you want to address the whole line as the key of the table (see also Pseudocomponent TABLE_LINE With Internal Tables).
    If you use one of the additions 2 to 5 before BY, it applies to all fields of the sort key by default. You can also specify these additions after each individual sort field f1, f2, ..., fn. For each key field, this defines an individual sort rule which overrides the default.
    Addition 2
    ... ASCENDING
    Effect
    Sorts in ascending order. This is also the default if no sort order is specified directly after SORT. For this reason, it is not necessary to specify ASCENDING explicitly as the default sort order.
    With the addition BY, you can also specify ASCENDING directly after a sort field to define ascending order explicitly as the sort sequence for this field.
    Addition 3
    ... DESCENDING
    Effect
    Sorts in descending order. If the addition comes right after SORT, DESCENDING is taken as the default for all fields of the sort key.
    With the addition BY, you can also specify DESCENDING directly after a sort field.
    Addition 4
    ... AS TEXT
    Effect
    Text fields are sorted appropriate to the locale. This means that the relative order of characters is defined according to the text environment being used.
    When an internal mode is opened (in other words, when a roll area is opened), the text environment is automatically set to the logon language specified in the user master record. If necessary, however, you can change the text environment explicitly in your program by using a SET-LOCALE statement.
    If the addition comes directly after itab, locale-specific rules are used for all fields of the sort key where the type of these fields is C or W. After the sort, the sequence of entries usually does not match the sequence which results otherwise, without using the addition AS TEXT, i.e. with binary sorting.
    With the addition BY, you can also specify AS TEXT directly after a sort field, provided it is of type C or W, or a structured type. Otherwise, a runtime error occurs. In sort fields with a structured type, AS TEXT only affects subcomponents with type C or W.
    In case of an invalid character, a SYSLOG message is written, and the respective record is inserted at the end.
    Note
    Please keep the rules for site-specific sorting in mind.
    Example
    Sort a name table with different keys:
    TYPES: BEGIN OF PERSON_TYPE,
             NAME(10)   TYPE C,
             AGE        TYPE I,
             COUNTRY(3) TYPE C,
           END OF PERSON_TYPE.
    DATA: PERSON TYPE STANDARD TABLE OF PERSON_TYPE WITH
                      NON-UNIQUE DEFAULT KEY INITIAL SIZE 5,
          WA_PERSON TYPE PERSON_TYPE.
    WA_PERSON-NAME    = 'Muller'. WA_PERSON-AGE = 22.
    WA_PERSON-COUNTRY = 'USA'.
    APPEND WA_PERSON TO PERSON.
    WA_PERSON-NAME    = 'Moller'. WA_PERSON-AGE = 25.
    WA_PERSON-COUNTRY = 'FRG'.
    APPEND WA_PERSON TO PERSON.
    WA_PERSON-NAME    = 'Möller'. WA_PERSON-AGE = 22.
    WA_PERSON-COUNTRY = 'USA'.
    APPEND WA_PERSON TO PERSON.
    WA_PERSON-NAME    = 'Miller'. WA_PERSON-AGE = 23.
    WA_PERSON-COUNTRY = 'USA'.
    APPEND WA_PERSON TO PERSON.
    SORT PERSON.
    Now, the sequence of the table entries is as follows:
    Miller  23  USA
    Moller  25  FRG
    Muller  22  USA
    Möller  22  USA
    If, for example, you apply German sort rules where the umlaut comes directly after the letter 'o' in the sort, the data record beginning with 'Möller' would not be in the right place in this sequence. It should come second.
    Provided a German-language locale is set (e.g. sorting is according to German grammatical rules, see also SET LOCALE), you can sort the names according to German rules as follows:
    SORT PERSON BY NAME AS TEXT.
    Now, the sequence of table entries is as follows:
    Miller  23  USA
    Moller  25  FRG
    Möller  22  USA
    Muller  22  USA
    Further examples:
    SORT PERSON DESCENDING BY COUNTRY AGE NAME.
    Now, the sequence of table entries is as follows:
    Miller  23  USA
    Möller  22  USA
    Muller  22  USA
    Moller  25  FRG
    SORT PERSON DESCENDING BY AGE ASCENDING NAME AS TEXT.
    Now, the sequence of table entries is as follows:
    Muller  22  USA
    Möller  22  USA
    Miller  23  USA
    Moller  25  FRG
    Addition 5
    ... STABLE
    Effect
    Uses a stable sort, that is, the relative sequence of entries that have the same sort key remains unchanged.
    Unlike additions 2 to 4, you cannot use this addition directly after a sort field.
    Notes
    General:
    The number of sort fields is restricted to 250.
    The sort process is only stable if you use the STABLE addition. Otherwise, a predefined sequence of fields used to sort a list is not usually retained.
    It does not make sense to use the SORT command for a SORTED TABLE. If the table type is statically declared, the system returns a syntax error if you try to SORT the table. If the table type is not statically declared (for example, because the table was passed to a FORM routine as an INDEX TABLE in a parameter), and the system can interpret the SORT statement as an empty operation, it ignores the statement. This is the case when the key in the BY clause corresponds to the beginning of the table key. Otherwise, a runtime error occurs.
    To delete all duplicate entries from a sorted internal table (e.g. just after SORT), you can use the DELETE ADJACENT DUPLICATES FROM itab statement.
    When using the addition AS TEXT, the sequence of entries after the sort does not usually match the sequence resulting from a binary sort, i.e. if the addition AS TEXT is not specified. The consequence of this is that after the SORT, you are not allowed to access with the READ TABLE itab ... BINARY SEARCH statement.
    If you still want to access data sorted apppropriate to the locale with a binary search, you can do this by including an additional component in the table where you can explictly store the data formatted using the CONVERT TEXT ... INTO SORTABLE CODE statement. This is also recommended for performance reasons if you have to re-sort the table several times according to locale-specific criteria.
    If the internal table has more than 2^19 lines or is larger than 12 MB, the system sorts it physically using an external auxiliary file. You can specify the directory in which the file should be created using the SAP profile parameter DIR_SORTTMP. By default, the system uses the SAP data directory (SAP profile parameter DIR_DATA).
    Notes
    Performance:
    The runtime required to sort an internal table increases with the number of entries and the length of the sort key.
    Sorting an internal table with 100 entries with a 50 byte key requires about 1300 msn (standardized microseconds). Using a 30-byte key, the runtime is about 950 msn.
    If one of the specified sort criteria is itself an internal table, SORT may sometimes take much longer.
    The runtime increases if you use a stable sort.
    Physical sorting reduces the runtime required for subsequent sequential processing.
    Reward If Useful.
    Regards,
    Chitra

  • Help needed badly Insert text data from xml files into tables

    Hi all, I have asked to do insertion of text from a xml file into tables upon receiving using pro*c. i've done quite an amount of research on xml parser in c but there wasn't much information for mi to use for implementation...
    Guys don't mind helping me to clarify few doubts of mine...
    1. Where can i get the oracle xml parser libs? Is it included when i installed oracle 8i?
    2. Is there any tutorials or help files for xml parser libs where i can read up?
    I need the xml parser to recognise the tags, followed by recognising the text after the tags.
    eg. xml format
    <studentID> 0012 </studentID>
    <student> john </student>
    <studentID> 0013 </studentID>
    <student> mary </student>
    text willl be inserted into tables like this:
    studentID | student
    0012 | john
    0013 | mary
    by the way i'm using oracle 8i on HP-UX. Thanks in advance.

    I can answer one of of your questions at least
    1. Where can i get the oracle xml parser libs? Is it included when i installed oracle 8i?You need the XML XDK. You can use http://www.oracle.com/technology/tech/xml/xdkhome.html as your starting point. I believe the 9i version works for 8i.
    I have no pro*c experience so I can't offer any other suggestions regarding how to do this in pro*c.

  • Need to get different data from same column in same query

    need party_name from table hz_parties once to get bank_name & other to get branch name in the same query ,,,, how can i do that?

    thx but it's not fetching what i need as wht i need excatly is as the following
    select distinct party_name -- branch_name or bank_name
    from hz_parties hz
    , hz_code_assignments bankca
    , hz_code_assignments branchca
    where
    -- bankca.class_category = 'BANK_INSTITUTION_TYPE'
    -- AND bankca.class_code IN ('BANK', 'CLEARINGHOUSE')
    branchca.class_category = 'BANK_INSTITUTION_TYPE'
    and branchca.class_code IN ('BANK_BRANCH', 'CLEARINGHOUSE_BRANCH')
    AND branchca.owner_table_id = hz.party_id
    -- AND bankca.owner_table_id = hz.party_id
    if class_code from table x = branch then select party_name from table y & call it branch
    else if class_code from table x =bank then select party_name from table y & call it bank

  • Get desired data from joining multiple tables

    I have the following query which is returning some data.
    SELECT i.IssueId, i.IssueDesc, i.MainRecId, a.PlantId
    FROM Issues i INNER JOIN PlantPcontact pp ON i.SubmitterId = pp.PContactId
    INNER JOIN Plant a ON a.PlantId = pp.PlantId
    WHERE (a.PlantStatus = 1)
    ORDER BY i.IssueId
    I need to join i.MainRecId and a.PlantId from the results of this query with another table PlantDoc (pd) ON PDMainRecId and PDPlantId respectively (one-to-one relationship) and retrieve additional information (pd.PlantDocId).
    How do I accomplish everything in one single query ?
    I am looking for the following data finally.
    i.IssueId, i.IssueDesc, i.MainRecId, a.PlantId, pd.PlantDocId

    Example for JOINs with many tables:
    http://www.sqlusa.com/bestpractices/fourtablejoin/
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Getting Customer data from Different R3 system to CRM

    Hi Gurus,
    I need to get Customer data from different R3 systems to CRM. But the problem is, the customer datas in these R3 systems have the same BP number, and the SD datas were defined same  in these R3 systems. Thus, when ı try to fetch these SD datas to CRM, it overwrites the existing datas.
    I have read different scenarios to solve this;
    1.  About Using Mapping.
    2.  About Working on different Clients.
    Do you have any solution or suggestion? Need your Help...
    Best Regards...

    Hi,
    The multplie backend scneario is supproted but wth restrictions and on a project basis. Unfortunealtey there's no simple document we can refer you to for this. You would need to involved SAP conuslting- please refer to note 1084315.
    Best regards,
    Brian.

  • Getting the system date from the dual table

    Hi, im just wondering if anyone can help me. I need to get the current date to enter into a message table saying that an email has been sent and im struggling to find a way to get the date. Should i try to get this date from the dual table, if so how can i get this oracle date type out of the resultset? or is there some easy way in java to do this without accessing the database??
    Thanks for any help
    Sean

    Date now = new Date();
    is the easy Java way to get the current date and time.

Maybe you are looking for

  • Mavericks lost after install Windows 8.1 on other partition

    So, I have MacBook pro 15' retina display running Mavericks. Then I need to have Windows 8.1 on my Mac as well for college, so I decided to have dual boot Mavericks and 8.1. After I successfully install my Windows, then I restart my computer cause I

  • Getting extra things in the uploaded file by flex file upload

    Hi, I am working on a application where I am using adobe flex. I have a requirement wher I have to upload file to the server. System allows user to browse file from local machine and flex uploads it to the server. Now there is a upload url, its a jsp

  • Elements 13 question

    Hi there! I have been using Photoshop Elements 7 for years and just upgraded to Elements 13. With 7 under the create tab you have colleges and there are many templates. With 13 when I got to create a collage I only have one template option. How do I

  • How to remove a stripped screw from an iPhone 4?

    Since APPLE is so kind as to tell me "You broke your iPhone's home button, you can replace the phone for $200 I decided I'll just open it up and replace it myself!" I just recently went to replace my iPhone 4 screen/home button and find a stripped sc

  • Redownloading lost purchased songs?

    I recently downloaded like 20 songs, and I haven't had a chance to put them on my iPod or anything. Today I went on my iTunes and some error cup and all my music was deleted from my iTunes. How do I re download the songs I've bought