Selecting Records from one table where records don't exist in a linked table

Post Author: RMC
CA Forum: Crystal Reports
Tables:
Stock (Main Table)
Transactions (Left Outer Join)
Criteria:
Select all items with no transactions between a selected date range.
The items will exist in Main table but I want to select all items that haven't been in a transaction between a date range so I can identify no movement with stock items just sitting in the database doing nothing.
Any suggestions??

Post Author: yangster
CA Forum: Crystal Reports
Sorry for the delay.  Dam meetings all day yesterday.You are essentially looking for something that doesn't exist in the db so you need to look at it from a different approach.You definitely don't want to use a full outer join.  From what i can tell from your description above you are looking for stocks that are inactive/idle.So you need not look at data that doesn't exist but the last activity date.So you'd want something along the lines ofselect s.stock_name, s.stock_blah, max(t.transaction_date) Transaction_datefrom stocks sjoin transactions t on s.itemid = t.itemidwhere whatever restrictions you need to addgroup by s.stock_name, s.stock_blahthis will produce one record for each stock you have in the stock table showing you only the last date of activityput that in a command in crystalin the selection expert in crystal reports put in a simple criteriatransaction_date <= some datethis will only pull in records based on your date selection so if you say give me all records from dec 31, 2006  you will know all the records being pulled in are stocks that have been idle since dec 31, 2006 or earlierlet me know if this doesn't work

Similar Messages

  • Select records from one database and insert it into another database

    Hi
    I need to write a statement to select records from one database which is on machine 1 and insert these records on a table in another database which is on machine 2. Following is what I did:
    1. I created the following script on machine 2
    sqlplus remedy_intf/test@sptd @load_hrdata.sql
    2. I created the following sql statements in file called load_hrdata.sql:
    rem This script will perform the following steps
    rem 1. Delete previous HR data/table to start w/ clean import tables
    rem 2. Create database link to HR database, and
    rem 3. Create User Data import table taking info from HR
    rem 4. Drop HRP link before exiting
    SET COPYCOMMIT 100
    delete from remedy.remedy_feed;
    commit;
    COPY FROM nav/donnelley@hrp -
    INSERT INTO remedy.remedy_feed -
    (EMPLID, FIRST_NAME, MI, LAST_NAME, BUSINESS_TITLE, WORK_PHONE, -
    RRD_INTRNT_EMAIL, LOCATION, RRD_OFFICE_MAIL, RRD_BUS_UNIT_DESCR) -
    USING SELECT EMPLID, FIRST_NAME, MI, LAST_NAME, BUSINESS_TITLE, WORK_PHONE, -
    RRD_INTRNT_EMAIL, LOCATION, RRD_OFFICE_MAIL, RRD_BUS_UNIT_DESCR -
    FROM ps_rrd_intf_medium -
    where empl_status IN ('A', 'L', 'P', 'S', 'X')
    COMMIT;
    EXIT;
    However, whenever I run the statement I keep getting the following error:
    SP2-0498: missing parenthetical column list or USING keyword
    Do you have any suggestions on how I can fix this or what am I doing wrong?
    Thanks
    Ali

    This doesn't seem to relate to Adobe Reader. Please let us know the product you are using so we may redirect you or refer to the list of forums at http://forums.adobe.com/

  • How to exclude records from one table that is contained in a second table

    I am trying to create a Crystal report that excludes records from one Table that is contained in a second table using the != link option and it is not working. I've tried all of the different enforce options, and it is still not excluding those records. Does anyone have any suggestions of what I'm doing wrong or any other suggestions how I can obtain the results I need?
    Thanks in advance!

    Have you tried by Command ?
    Thanks,
    Gordon

  • Re: Transferring records from one request to another.

    Hi Guys,
    Currently the pseudo delta is loaded with posting date selection as two months(say, may and june- 2 lakh records).
    Every two months once we do full update (3 million records).
    every day we delete the delta request and load data, the full load request will be available.
    for some reason, i want to move few data available in the delta request to full update request. bcoz i have done changes in the routine level, which adds up new record to dso. I want to move these added records to full update request. Bcoz the delta request is deleted daily and loaded. I dont wnat my changes to be executed daily. Bcoz the changes i done in routine level takes more time to complete the dtp.
    Is it possible to move selected records from one request to another? If yes, i will move the record to full update and revert the routine change. so that my data load will be faster.
    Regards,
    Anand

    Close

  • Transfer Customer Master records from one company code to another company.

    hi ,
        working on a rollout project ,
    needed to transfer Customer Master records from one company code to another company code.
    is there any sap standard BDC/T-code as in case of Vendor Master FK15,Fk16(T-CODE) .
    thanks in advance.
    rahul
    Edited by: RAHUL SINGH on Jul 22, 2009 9:05 AM

    Hi,
    I think you should ask this question in functional consultant forum.
    Thanks,

  • How to call a form with dabble clicking on a record with one time where

    Hi All,
    How to call a form with dabble clicking on a record with one time where clause. I mean when i dabble click on the current record i want to call another form with details of the
    record with onetime where clause. Can anyone help me in this regard.
    Now i am calling a form with parameter with onetime where but this should avoid.
    Thanks in advance
    Arif

    Hello,
    I mistakenly mark it as solved. There is a problem remain. when i placed the code below it do not execute with the where condition. I mean the condition to execute is not work.
    All records executes. Please correct my code--
    Here the WHEN-BUTTON-PRESSED-trigger on the Edit-Button:
    :GLOBAL.MODE:='EDIT';
    :GLOBAL.REQ_ID:=:PROBLEM_REQUEST.REQ_ID;
    CALL_FORM('REQUEST_ID_PARAM',NO_HIDE,DO_REPLACE,NO_QUERY_ONLY);And also, WHEN-NEW-FORM-INSTANCE-trigger of REQUEST_ID_PARAM:
    DEFAULT_VALUE(NULL, 'GLOBAL.MODE');
    DEFAULT_VALUE(NULL, 'GLOBAL.REQ_ID');
    IF :GLOBAL.MODE='EDIT' THEN
    GO_BLOCK('PROBLEM_REQUEST');
    EXECUTE_QUERY;
    SET_BLOCK_PROPERTY('PROBLEM_REQUEST', INSERT_ALLOWED, PROPERTY_FALSE);
    END IF;Arif

  • How to insert select columns from one internal table to another

    Hi,
    How to insert select columns from one internal table to another based on condition as we do from a standart table to internal table.
    regards,
    Sriram

    Hi,
    If your question is for copying data from 1 int table to other ;
    we can use
    APPEND LINES OF it_1 TO it_2.
    or if they have different columns then:
    loop at it_1 into wa_it1.
    move wa_it1-data to wa_it2-d1.
    apped wa_it2 to it_2.
    clear wa_it2.
    endloop.
    thnxz

  • If i transfer some records from one server to another server,

    hi to all......
    5........If i transfer some records from one server to another server, will that save in change request or work bench request?
    thanks and regards,
    k.swaminath

    Hi friend my suugession is , if u r transfering records from one client to another or changing anything in the active pgm, it will save under  change request...
    But if u r transfering records from one server to server it will save under work bench request...

  • I want to diaplay my records from the databasewith 10 records per page. i l

    i want to diaplay my records from the databasewith 10 records per page. i learned that it can be done through pagination . Please can anyone there help me and give me the code of how to page my records in my jsp pages
    I have small code ,but its not working....
    below is the code....
    public ResultSet codeResult(int i){
    if(dataSource!= null){
         try {
                             con=dataSource.getConnection();
         stmt=con.createStatement (ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
         int maxRows=stmt.getMaxRows();
         System.out.println("the maxRows is:"+maxRows);
         System.out.println("the I value is:"+i);
         if((i < 0) || (i > maxRows)){
              i=0;
         stmt.setFetchSize(i);
         long t = System.currentTimeMillis();
         rs=stmt.executeQuery("select asc_code,countrycode,asc_name,asc_address1,asc_address2,asc_city,asc_country,asc_region,asc_contact_person,asc_contact_no,asc_email_id,asc_fax_no,nso_incharge,nso_email,ar_ap_code from asc_master order by asc_code asc");
    but,its giving all records...
    any one help me on this........
    Thank you,
    D.Nagireddy.                    
                        } catch (SQLException e) {
                             e.printStackTrace();
              return rs;
              }

    hey, here my code for paging. hope it helps...
         public void DueRecordInfo(int page,int MAX_PER_PAGE)
              con = new DBConnection().getConnection();
             try
                     Statement stmt = con.createStatement();
                     String sqlcount = "SELECT COUNT(*) FROM INFO WHERE TO_DATE(DATEUPDATED,'Month DD, YYYY') < ADD_MONTHS(SYSDATE,-6) AND OBSOLETE LIKE 'No'";
                     ResultSet rscount = stmt.executeQuery(sqlcount);     
                    rscount.next();
                    total_row_count = rscount.getInt(1);
                  lowerbound = (page * MAX_PER_PAGE - (MAX_PER_PAGE))+1;
                  upperbound = lowerbound - 1 + MAX_PER_PAGE;
                  String sql = "Select * from "+
                                    "(SELECT row_number() over(ORDER BY TO_DATE(DATEUPDATED,'Month DD, YYYY') DESC) AS RN,ID,SPECNO,REVISEDNO,DATEREVISED,TITLE,ORIGINATOR,DCBNUMBER,DCBLOCATION,OBSOLETE,DATEOBSOLETE,WORDFILE,PDFFILE,DATEUPDATED FROM INFO WHERE TO_DATE(DATEUPDATED,'Month DD, YYYY') < ADD_MONTHS(SYSDATE,-6) AND OBSOLETE LIKE 'No') " +
                                    "WHERE RN BETWEEN "+ lowerbound + " AND " +upperbound;
                   ResultSet rs = stmt.executeQuery(sql);
                  while (rs.next())
                         id.add(num, rs.getString("ID"));
                         specno.add(num, rs.getString("SPECNO"));
                         revisedno.add(num, rs.getString("REVISEDNO"));
                       daterevised.add(num, rs.getString("DATEREVISED"));
                       title.add(num, rs.getString("TITLE"));
                       originator.add(num, rs.getString("ORIGINATOR"));
                       dcbnumber.add(num, rs.getString("DCBNUMBER"));
                       dcblocation.add(num, rs.getString("DCBLOCATION"));
                       obsolete.add(num, rs.getString("OBSOLETE"));
                       dateobsolete.add(num, rs.getString("DATEOBSOLETE"));
                       wordfile.add(num, rs.getString("WORDFILE"));
                       pdffile.add(num, rs.getString("PDFFILE"));
                       dateupdated.add(num, rs.getString("DATEUPDATED"));
                         num++;
                   con.close();
                   rscount.close();
                   rs.close();
                   stmt.close();
             }

  • How get all record from master and matching record from detail

    hi master
    sir i have master detail table
    i have many record in master table but some record in detail table how i get
    all record from master and matching record from detail
    such as
    select m.accid,m.title,d.dr,d.cr from master m, detail d where m.accid=d.accid
    this query not work that get only related record i need all record from master
    please give me idea
    thanking you
    aamir

    hi master
    sir i have master detail table
    i have many record in master table but some record in
    detail table how i get
    all record from master and matching record from
    detail
    such as
    select m.accid,m.title,d.dr,d.cr from master m,
    detail d where m.accid=d.accid
    this query not work that get only related record i
    need all record from master
    please give me idea
    thanking you
    aamir
    select m.accid,m.title,d.dr,d.cr
    from master m, detail d
    where m.accid=d.accid (+)The outer join operator (+) will get you all the details from master and any details from the detail if they exist, but the master details will still be got even if there are not details.
    Note: Oracle 10g now supports ANSI standard outer joins as in:
    select m.accid,m.title,d.dr,d.cr
    from master m LEFT OUTER JOIN detail d on m.accid=d.accid

  • How can i add selected element from one node to other node

    Hi All
    I have below requirement.
    Say In the view leftside Available Languages ItemList Box  Rightside Available Languages ItemList Box and Add & Remove Buttons in the middle.
    User selects languages from Available Languages ItemList Box clicks on add it will adds to the Available Languages Item List box and ViceVersa with Remove Button.
    1) I have created 2 nodes 1) AvlLang 2) SelLang both contains two attributes Key and Value.
    2) For AvlLang node,  Property : Data Dictonary binded with table. Values are coming fine in Available Languages ItemList Box.
    3) How can i add selected language into the node Available Languages.
    Please provide the code snippet how to achieve this.
    BR
    X- CW

    Hi Carlin,
    Find below code to copy selected record from one node to another.
    Here I am copying it_lips node into pack_mat node.
    DATA: wa_temp TYPE REF TO if_wd_context_element,
                lt_temp TYPE wdr_context_element_set,
                count type c.
          DATA : lo_nd_it_lips TYPE REF TO if_wd_context_node,
                 lo_el_it_lips TYPE REF TO if_wd_context_element,
                 ls_it_lips TYPE wd_this->Element_it_lips,
                 lt_it_lips TYPE wd_this->Elements_it_lips,
                 ls_unpack TYPE wd_this->Element_unpack,
                 lt_unpack TYPE wd_this->Elements_unpack.
    * navigate from <CONTEXT> to <IT_LIPS> via lead selection
          lo_nd_it_lips = wd_context->path_get_node( path = `ZRETURN_DEL_CHANGE.CHANGING_3.IT_LIPS` ).
          CALL METHOD lo_nd_it_lips->get_selected_elements
            RECEIVING
              set = lt_temp.
    * navigate from <CONTEXT> to <PACK_MAT> via lead selection
          lo_nd_pack_mat = wd_context->get_child_node( name = wd_this->wdctx_pack_mat ).
          LOOP AT lt_temp INTO wa_temp.
            CALL METHOD wa_temp->get_static_attributes
              IMPORTING
                static_attributes = ls_it_lips.
                  ls_pack_mat-vgbel = ls_it_lips-vgbel.
                  ls_pack_mat-vgpos = ls_it_lips-vgpos.
                  append ls_pack_mat to lt_pack_mat.
                  CLEAR ls_pack_mat.
          endloop.
            lo_nd_pack_mat->bind_table( new_items = LT_PACK_MAT
                                        SET_INITIAL_ELEMENTS = abap_true ).
    Cheers,
    Kris.

  • How To Copy Selected Music From One Library to Another?

    What is the best way to copy selected music from one library to another?
    I have a big and growing iTunes library -- 33,000 songs.
    A year ago I copied my library to my daughter's new iMac.  Now, a year later, I'm off to visit her and wonder how best to update her library.  In the past year I have added a number of items to my library and I'm sure she has done the same -- some might be the same but many will be different.
    How do I update her library with the new things I've added in the past year but not wipe out things she had added or duplicate when we each have a song?
    I can load any / all of my stuff on an external HD and take that to plug in to her computer.  Then what?  I want to avoid duplicates and make sure I get stuff like album artwork.
    I'm running iTune 10.4 on an iMac with OS X 10.6.8 -- my daughter will have the same iTunes and OS X once we update her software.
    Any advice would be great.
    Thanks

    If you're sharing the same Apple ID and all your songs are from the iTunes Store, it's easy:
    In iTunes on your computer, go to File->Preferences->Store and check the box next to MUSIC under AUTOMATIC DOWNLOADS.
    You should also read this article, the section titled TO DOWNLOAD PREVIOUSLY PURCHASED APPS, BOOKS, MUSIC, OR TV SHOWS TO YOUR COMPUTER:
    http://support.apple.com/kb/ht2519
    You could also use an rsync utility such as backuplist+ to perform a 2-way sync of the files in your two libraries while your computers are connected via FireWire with one of them in FireWire Target Disk Mode, or from your external hard drive with your daughter's computer and then to yours again. After that, you'll need to use iTunes on each computer to update its library with the new files:
    http://rdutoit.home.comcast.net/~rdutoit/pub/robsoft/pages/backup.html
    This last would also be the preferred method if you have authorized each other's computers for media purchased with each other's Apple IDs (i.e. you are not sharing the same Apple ID), or if you have music from sources other than the iTunes Store. Most likely, though, music from sources other than the iTunes Store would not be legal to copy in this way for this purpose, although there is probably no technical impediment.

  • Magic wand selection shape from one layer, drop to sub layer and copy that shape from that layer.

    In PS i can Magic wand selection shape from one layer, drop to sub layer and copy that selected shape from that sub layer. How do I do this in illistrator, and moreover, from multiple layer at the same time.
    For instance, in PS = Import an image of gold - select a text phrse with wand - drop to gold - copy paste = gold text.
    How is this done in illustrator?

    Illustrator C6
    Basicly I want to do what takes me 10 minutes to do in PS in Illistrator. LOL! I realize I must learn Illistrator; especially for logo design.
    I want to select my objects in Illistrator and drop to another layer and copy that layer but with only the selection to create another new layer with that which I
    originally selected and then copied from another layer.
    1. Select objects
    2. copy that selection from another image. "gold effect taken from an image"
    3 paste that which was selected = that which was selected, but in gold.

  • I am getting an Narration error that I can't record because one of the record-enabled tracks is locked in the timeline. What does this mean and how do I get out of it??

    I am getting an Narration error that I can't record because one of the record-enabled tracks is locked in the timeline. What does this mean and how do I get out of it??

    JohnL23
    Thanks for the update.
    There are several Adobe Premiere Elements Forum threads about situation such as the one that you have encountered. Typically they are the results of some heavy activity in the narration track.  Some have found success in maneuvers between the Expert and Quick workspaces in versions 11 and 12 or Timeline and Sceneline workspaces in versions earlier than 11. That is why I mentioned that type of factor in a prior post in your thread.
    If that is not working, then we are forced into the new project where the problems in the current project are not presenting.
    I will do a search for the threads that I am recalling about your type of issue. But, right now all roads seem to head to the new project. But I would ask "Can you salvage this project by creating your narration clips in Audacity or a new Premiere Elements project and import them into this project, putting the clips on one of the numbered audio tracks?"
    If the problem should reappear in the new project, please let us know including the details of what was going on immediate before the problem surfaced.
    Thanks.
    ATR

  • How do I transfer selected photos from one iPhoto library to another?

    How do I transfer selected photos from one iPhoto library to another?

    iPhoto Library Manager - http://www.fatcatsoftware.com/iplm/ -
    Generally it is not advised to have multiple Photo libraries - but if you do you need IPLM to manage them
    LN

Maybe you are looking for