Possible to link the two tables?

Dear All,
I am currently trying to create a report where the user will enter in the customer code and then using discounts on item groups to create a sales price (list price - customer discount = sales price). I'm currently trying to do this in crystal reports but I just can't seem to get the values.
The problem I have is the OITM.Itemgroupcode is of type number (from the item table) where the OSPG.ObjKey is of type string (this represents the itemgroup code in the Discount table). Because of the different types I cannot link the two fields. If they were the same then it should be easy but I can't seem to get around this.
Does anyone have any idea of what I could do to resolve my issue, while I am trying to do this with crystal currently I'm not locked into using this platform.
Any help and comments are much appreciated.
Troy

Hi Troy,
Welcome you post on the forum.
Try this to start:
SELECT T0.ItemCode, T1.CardCode, T1.Discount
FROM OITM T0
INNER JOIN OSPG T1 ON CAST(T1.ObjKey AS INT)=T0.ItmsGrpCod
WHERE T0.ItmsGrpCod like '[%0\]%'
If you get result, you can create a Command for your CR report.
Thanks,
Gordon

Similar Messages

  • I have an iPad1 and just purchased an iPad Air, both on the same iTunes account. Is it possible to UNSYNC the two iPads. I would like to use the iPad1 as a library for my frequent guests: KINDLE, AUDIBLE,

    I have an iPad1 and just purchased an iPad Air, both of which are on the same iTunes account. Is it possible to UNSYNC the two iPads with the purpose of using the iPad1 as a "Bare-Bones" library for my frequent guests: The content of my KINDLE, AUDIBLE, & ZINIO Accounts/Apps. How would I go about doing this, if it is at all possible?

    Is it possible to have an Iphone and an IPAD on the same Itunes account on a PC?
    yes.
    the number of mobile devices you can use with a single instance of iTunes is virtually unlimited.
    How to use multiple iPods with one computer

  • Can we implement the custom sql query in CR for joining the two tables

    Hi All,
    Is there anyway to implement the custom sql query in CR for joining the two tables?
    My requirement here is I need to write sql logics for joining the two tables...
    Thanks,
    Gana

    In the Database Expert, expand the Create New Connection folder and browse the subfolders to locate your data source.
    Log on to your data source if necessary.
    Under your data source, double-click the Add Command node.
    In the Add Command to Report dialog box, enter an appropriate query/command for the data source you have opened.
    For example:
    SELECT
        Customer.`Customer ID`,
        Customer.`Customer Name`,
        Customer.`Last Year's Sales`,
        Customer.`Region`,
        Customer.`Country`,
        Orders.`Order Amount`,
        Orders.`Customer ID`,
        Orders.`Order Date`
    FROM
        Customer Customer INNER JOIN Orders Orders ON
            Customer.`Customer ID` = Orders.`Customer ID`
    WHERE
        (Customer.`Country` = 'USA' OR
        Customer.`Country` = 'Canada') AND
        Customer.`Last Year's Sales` < 10000.
    ORDER BY
        Customer.`Country` ASC,
        Customer.`Region` ASC
    Note: The use of double or single quotes (and other SQL syntax) is determined by the database driver used by your report. You must, however, manually add the quotes and other elements of the syntax as you create the command.
    Optionally, you can create a parameter for your command by clicking Create and entering information in the Command Parameter dialog box.
    For more information about creating parameters, see To create a parameter for a command object.
    Click OK.
    You are returned to the Report Designer. In the Field Explorer, under Database Fields, a Command table appears listing the database fields you specified.
    Note:
    To construct the virtual table from your Command, the command must be executed once. If the command has parameters, you will be prompted to enter values for each one.
    By default, your command is called Command. You can change its alias by selecting it and pressing F2.

  • Can I use the screen/monitor from my G4-iMac-linking the two together?

    Bought a new Mini and am just wondering if I can use the monitor of the iMac if I link the two computers together?
    TIA
    R

    The only real option is a VNC solution like this:http://www.screenrecycler.com/home.html
    cheers
    mrtotes

  • How to insert the data if the data in the two tables doesn't match.

    Hi,
    I have requirement like,I have to insert the data by comparing the two tables based on the date field.If they both are equal then the data shouldn't be inserted if not the data has to be inserted.
    Can some one help me on this ASAP.
    Regards,
    Sudha
    sudha

    Hi,
    Thanks for the reply,i would like to know the way that we can design the packages
    sudha
    You have multiple ways of implementing this
    1. Using Lookup Task
    http://www.sqlis.com/sqlis/post/Get-all-from-Table-A-that-isnt-in-Table-B.aspx
    2. using SCD wizard
    http://www.bimonkey.com/2009/07/the-slowly-changing-dimension-transformation-part-1/
    3. using hashing
    http://visakhm.blogspot.in/2014/06/ssis-tips-implementing-scd.html
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Linking the two  Item catalog category in PIM

    Hi all,
    I am new to oracle Product Information Management(PIM) in R12. How to link the Two Item catalog category(ICC) hierarchy structure.
    Please help,
    Thanks
    Prab.

    Have you tried Inventory > setup > items > catalogs groups > parent catalog groups

  • Is it possible to customize the ARUN table (J_3ABDBS) and delivery creation program (transaction VL04) in SAP?

    I am a student, pursuing MBA and currently doing internship with a big fashion and lifestyle company in India. I am stuck at a place where i need help.
    We are planning to give customer the control over the time of delivery of their orders as per their convenience. For that I am exploring the possibility of modifying the ARUN table in such a way that an extra column is added into the ARUN table. this field will contain a flag value (1/0) where '0' will indicate that the customer wants to block delivery for the specific items.
    at the time of delivery creation, transaction VL04 should check this flag value for every item. So when we try to create delivery for a whole order in one go, the delivery for the items with '0' flag value shouldn't be created.
    basically, my whole purpose is to enable our SAP system to create delivery on item level instead of on order level.
    Ques:
    1. Is it at all possible to do what i am thinking of?
    2. has any company customised the ARUN table and delivery creation program before?
    3. If we go ahead with this customisation in-house, will the SAP pull back the maintenance support on account of tempering with base programs?
    4. Also, please suggest other ways to do what i am trying to do?

    you can use the Tables SRRELROLES and IDOCREL
    if it is inbound delivery the use the business object BUS2015(outbound use LIKP)
    first get the ROLEID using the Delivery number as Objectkey(business obecjt BUS2015/LIK) from the SRRELROLES,
    then pass the ROLEID to the table IDOCREL to ROLE_A , get the ROLE_B,
    use this ROLE_B supply to ROLEID of SRRELROLES table(business object as IDOC, )
    get the objkey which is nothing But IDOC.

  • I registered my camera and lens before creating an account. How do I link the two now?

    I registered my camera and lens before creating an account. How do I link the two now?

    This is a public forum. You may want to contact Canon Support to help.
    EOS 1Ds Mk III, EOS 1D Mk IV EF 50mm f1.2 L, EF 24-70mm f2.8 L,
    EF 70-200mm f2.8 L IS II, Sigma 120-300mm f2.8 EX APO
    Photoshop CS6, ACR 8.7, Lightroom 5.7

  • Is it possible to get the updated table records based on date & time.

    Is it possible to get the updated table records based on date & time in oracle.
    Thanks in advance.

    no, actually i am asking update records using 'UPDATE
    or DELETE' statement, but not insert statement.
    Is it possible?
    I think we can do using trigger on table, but problem
    is if i am having 20 tables means i have to write 20
    trigger. i don't want like this.Of course it's still possible, typically you'll find applications with a column LAST_UPDATE, probably a LAST_UPDATED_BY and so on column. You don't say what your business need is, if you just want a one of query of updates to particular records and have a recent version of Oracle, then flashback query may well help, if you want to record update timestamps you either have to modify the table, or write some code to store your updates in an audit table somewhere.
    Niall Litchfield
    http://www.orawin.info/

  • HT3231 I have completed migration, is it possible to merge the two account now? or a short cut to share information? I don't want to log in and out each time I want to see my old data.

    I have completed migration, is it possible to merge the two account now? or a short cut to share information? I don't want to log in and out each time I want to see my old data.

    No, the camera connection kit only supports the copying of photos and videos to the Photos app, it doesn't support copying content off the iPad. For your second camera instead of the SD reader part of the kit, does the iPad to camera cable not work with it for direct transfer to the iPad ?
    For Lightroom and Nikon software again no - you can only install apps that are available in the iTunes app store on your computer and the App Store app on the iPad, 'normal' PC and Mac (OS X) software are not compatible with the iPad (iOS). There are some apps that perform fairly basic editing functions that are available in the store, but nothing as sophisticated as, for example, Lightroom.

  • How to get the 'link' between two tables

    hi pple
    i need to find out HOW two tables are related.
    sample tables:
    SHIPS ( HULL_ID [PK] , VESSEL_NAME, GROSS_TONNAGE )
    EQUIPMENT ( E_ID [PK] , HULL_ID [FK frm SHIPS], DESC )
    PARTS ( PART_ID [PK] , E_ID [PK, FK frm EQUIPMENT], MANUFACTURER_ID)
    --> SHIPS and PARTS are some how related thro' EQUIPMENT.
    i need to get this relationship:
    Ships --> Equipment (E_ID) --> PARTS
    currently, i can get the direct parent and child tables of a given table using:
    SELECT lpad ( ' ', 2 * ( LEVEL - 1 ) ) || table_name as Child_Tables
    FROM ALL_CONSTRAINTS
    START WITH R_CONSTRAINT_NAME in
    select constraint_name
    from all_constraints
    where table_name = '%table_name%'
    and constraint_type = 'P'
    CONNECT BY PRIOR CONSTRAINT_NAME = R_CONSTRAINT_NAME ;
    To get ALL parents:
    SELECT lpad ( ' ', 2 * ( LEVEL - 1 ) ) || table_name as Parent_Tables
    FROM ALL_CONSTRAINTS
    where owner = 'CHARTUSER'
    START WITH CONSTRAINT_NAME in
    select constraint_name
    from all_constraints
    where table_name = '%table_name%'
    and constraint_type = 'R'
    CONNECT BY PRIOR R_CONSTRAINT_NAME = CONSTRAINT_NAME ;
    what i need to do is:
    1) get children & parents of SHIPS
    2) for each element of (1), get children, parents till i get PARTS
    3) so, i will get EQUIPMENT and then, PARTS.
    this wud be very expensive. my appln is in Java and i will need to call these functions - that makes it more complex. is there any simpler way out?
    and my main problem is to find out WHAT attributes line two tables. this wudnt be a big deal if it were just simple parent-child tables. but, how do i find out the attributes that link PARTS and SHIPS table?
    any ideas? -please help.
    thanks in advance
    --$uDhA

    Dear Srikanth,
    This tables can be used once we come to know whether its a customer or vendor line item but in our case we using the GL account as reference have to knock off the entries.How we come to know that aginst the GL whether its a customer or vendor line item.. Then it should route to this table.
    Suggest me if any options are there.
    Regards,
    Balaji.c

  • How link between the two tables

    Hi All
    In fact, I am new in Oracle and also, in this forum, and I hope that I find useful and benefited also reportedly.
    My oracle is Oracle Database 10g Express Edition.
    I have now two tables and one for staff and the second of the equipment used by staff.
    Well now how link between tables in the agenda third.
    Thanks

    You could read one of the many books on the subject, or you could just try something real simple like
    SQL> desc a
    Name                    Null?    Type
    USERNAME                NOT NULL VARCHAR2(30)
    PROFILE                 NOT NULL VARCHAR2(30)
    SQL> desc b
    Name                    Null?    Type
    USERNAME                         VARCHAR2(30)
    ROLENAME                NOT NULL VARCHAR2(30)
    SQL> select * from a natural join b;
    USERNAME         PROFILE      ROLENAME
    USER_ONE         DEFAULT      CRISYS_SYSADMIN
    USER_TWO         END_USER     USER_CONNECT
    USER_TWO         END_USER     CARS_APP_USER
    USER_THREE       BATCH_USER   BATCH_CONNECT
    USER_THREE       BATCH_USER   APPLICATION_OWNER
    etc.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Is it possible to name the results table.

    Hi, I'm new to java and have hit a brick wall devloping a GUI which access a SAPDB database.
    They layout of the GUI is:
    have a awt lists in card layout, which is populated with the results of a SQL query to table REGION.
    However the number of results returned can be greater then 1Mill. To minimise the mem useage, i'm using the ResultSet absolute(), first() etc methods to collect and display small chunks of the data, for the different card in the gui. This works fine :)
    However, the user is able to select an item from the list to perform a new query, which the results a presented in a dialog box, not dependent on the parent frame. Works :)
    But, when the user (I) try to move anothe card in the parent frame I get this error:
    SAP DBTech JDBC: Object is closed
    com.sap.dbtech.jdbc.exceptions.ObjectIsClosedException: SAP DBTech JDBC: Object is closed
    at com.sap.dbtech.jdbc.ConnectionItem.assertOpen(ConnectionItem.java:54)
    at com.sap.dbtech.jdbc.ResultSetSapDB.beforeFirst(ResultSetSapDB.java:177)
    at blastDb.Table.getResultSetSize(Table.java:205)
    at blastDb.Table.setCursor(Table.java:227)
    at ViewDatabase$RegionPanel.setRegionList(ViewDatabase.java:354)
    at ViewDatabase$TabPanel.showRegionList(ViewDatabase.java:180)
    at ViewDatabase$TabButtonListener.actionPerformed(ViewDatabase.java:289)
    at java.awt.Button.processActionEvent(Button.java:381)
    at java.awt.Button.processEvent(Button.java:350)
    at java.awt.Component.dispatchEventImpl(Component.java:3526)
    at java.awt.Component.dispatchEvent(Component.java:3367)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:191)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)
    After some reading I have come up with this hypothesis:
    In the parent frame there is the object (class) RegionTable, which contains the ResultSet (rsR) of the sql query generated by it.
    In the dialog box there is the object (class) ProteinTable which also contains the ResultsSet (rsP) of the sql query generated by it.
    So when RegionTable querys the database the rsR points to the results table in the SAPDB. All good.
    However when ProteinTable querys the database, rsR closes and rsP is valid ie. points to the results table in the SAPDB.
    Thus after the second query RegionTable.rsR is unable to collect the results of its query. BAD :(
    From what i have read, if the results table is named for the first query, the second call which results table is named something diff then rsR will not close, as the results table is not destroyed, thus rsR can read it's results after the second qury.
    This problems occours when the objects share the same connection or diff connections.
    As far as I'm aware i'm using JDBC 1.2 drivers and SAPDB latest build.
    I know i could hold the results in a view, but that requies more coding, being able to name the results table in the SAPDB make it alot easier.
    So my question is:
    1. Are my assumptions correct??
    2. is there a SQL statement to name the results table for a given query?
    From SAPDB:
    A result table name identifies a result table (see table).
    Syntax
    <result_table_name> ::= <identifier>
    And I've got no idea what is beging impiled beyond that it is possible to name a results table. Obtained from :
    http://www.sapdb.org/htmhelp/da/ed9036dfe4b903e10000009b38f889/frameset.htm
    If anyone can help, that would be fantastic!!!
    Cheers
    fauxn

    I've check the code, when the dialog box is opened a new connection is made, and i still get the same error:
    SAP DBTech JDBC: Object is closed
    com.sap.dbtech.jdbc.exceptions.ObjectIsClosedException: SAP DBTech
    JDBC: Object is closed
    at com.sap.dbtech.jdbc.ConnectionItem.assertOpen(Connection
    Item.java:54)
    at com.sap.dbtech.jdbc.ResultSetSapDB.beforeFirst(ResultSet
    SapDB.java:177)
    at blastDb.Table.getResultSetSize(Table.java:205)
    at blastDb.Table.setCursor(Table.java:227)
    at ViewDatabase$RegionPanel.setRegionList(ViewDatabase.java
    :354)
    at ViewDatabase$TabPanel.showRegionList(ViewDatabase.java:1
    80)
    at ViewDatabase$TabButtonListener.actionPerformed(ViewDatab
    ase.java:289)
    at java.awt.Button.processActionEvent(Button.java:381)
    at java.awt.Button.processEvent(Button.java:350)
    at java.awt.Component.dispatchEventImpl(Component.java:3526
    at java.awt.Component.dispatchEvent(Component.java:3367)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Ev
    entDispatchThread.java:191)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Even
    tDispatchThread.java:144)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThr
    ead.java:138)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThr
    ead.java:130)
    at java.awt.EventDispatchThread.run(EventDispatchThread.jav
    a:98)
    when i ask rsR to collect the results from it's query.
    Dosen't make sence, unless its they way I'm implementint the GUI???
    I'll look into the JDBC driver bug.
    Cheers

  • Need to update column in table from joining the two tables

    Hi
    i want to update a table by joining two table but i m getting the below error
    single row subquery returns more than one value.
    i m using following query
    update table2
    set deposite_date=(select a.deposit_date from table1 a,table2 b
    where a.ban=b.ban and (a.deposit_date between b.cy_start_date and b.due_date))
    table2
    ban due_date cy_start_date deposite_date
    100 5/6/2011 22/05/2011
    101 7/11/2011 22/05/2011
    102 5/25/2011 22/05/2011
    table1
    ban      deposit_date
    100      04/12/2011
    100      04/15/2011
    102      03/25/2011
    101      04/26/2011
    101      05/06/2011
    101      07/26/2011
    can i insert latest deposit_date from table1 which lies between b.cy_start_date and b.due_date
    Thanks

    Hi,
    Welcome to the forum!
    876466 wrote:
    Hi
    i want to update a table by joining two table but i m getting the below error
    single row subquery returns more than one value.Exactly!
    (   SELECT  a.deposit_date
        FROM    ...returns all deposit_dates.
    (   SELECT  MAX (a.deposit_date)
        FROM    ...would return only the latest one.
    Also, you need to correlate the sub-query to the main query, so that it only looks for rows with the same ban.
    i m using following query
    update table2
    set deposite_date=(select a.deposit_date from table1 a,table2 b
    where a.ban=b.ban and (a.deposit_date between b.cy_start_date and b.due_date))
    table2
    ban due_date cy_start_date deposite_date
    100 5/6/2011 22/05/2011
    101 7/11/2011 22/05/2011
    102 5/25/2011 22/05/2011
    table1
    ban      deposit_date
    100      04/12/2011
    100      04/15/2011
    102      03/25/2011
    101      04/26/2011
    101      05/06/2011
    101      07/26/2011
    can i insert latest deposit_date from table1 which lies between b.cy_start_date and b.due_datePerhaps you need something like this:
    UPDATE  table2     b
    SET     deposit_date     =
             (    SELECT  MAX (a.deposit_date)
                   FROM      table1           a
               WHERE      a.ban          = b.ban
               AND      a.deposit_date BETWEEN b.cy_start_date
                               AND     b.due_date
    ;Notice that table1 is the only table in the FROM clause of the sub-query, but the sub-query is correlated to table2, so we can reference columns from table2 in the sub-query.
    Whenever you have a problem, post CREATE TABLE and INSERT statements for your sample data.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    If you're asking about a DML statement, such as UPDATE, the CREATE TABLE and INSERT statements should re-create the tables as they are before the DML, and the results will be the contents of the changed table(s) when everything is finished.
    Always say which version of Oracle you're using.
    Edited by: Frank Kulash on Aug 1, 2011 1:58 PM

  • How to find the unmatched records between the two tables?

    We have to tables in SQL Server database.
    But unable to find the unmatched record betwwen these two tables.
    There 12 records are unmatched. But unable to get those records.
    I am using the below sql:
    select c1,c2,c3,c4,c5,c6 from Table1
    except select c1,c2,c3,c4,c5,c6 from Table2
    Please help. Thanks in advance.

    Hi knra,
    Please try the following codes:
    select c1,c2,c3,c4,c5,c6 from Table1 t1
    where not exists
    (select * from Table2 t2
    where t1.c1= t2.c1
    and t1.c2= t2.c2
    and t1.c3= t2.c3
    and t1.c4= t2.c4
    and t1.c5= t2.c5
    and t1.c6= t2.c6)
    Best Regards,
    Allen Li
    Allen Li
    TechNet Community Support
    This is what I would've said, but it would make life much easier for you if you have a reference or ID for each entry, this is why we use keys.

Maybe you are looking for