4 Replies Latest reply: Aug 1, 2011 9:06 AM by rasmus1234 RSS

    Left join

      Hi, I cannot get this to work and I am not good a writing scripts. How do I get the Left Join to work? How do I write it?

       

       

      ODBC CONNECT TO EGDTA;

      LOAD FKFIRM As FIRMA, FKPRC, FKKUNR, FKFKDT, FKSAG, FKFKNR, FKAN, FKVAGR, FKVANR, FKFBEL, FKKBEL, FKKMPG, FKKKT As Konteringskode, FKLAG, FKSLG As `Sælger`, FKRDGL, FKSPRM As `Pristilsætning`, FKSAGB As Sagsbehandler,"FKLMÅD" As LevMaadeKode, FKVAKT As Varekontering, FKFORS As Forsendelseskode, FKENH;

      SQL SELECT FKFIRM, FKPRC, FKKUNR, FKFKDT, FKSAG, FKFKNR, FKAN, FKVAGR, FKVANR, FKFBEL, FKKBEL, FKKMPG, FKKKT,FKLAG, FKSLG, FKRDGL, FKSPRM, FKSAGB, "FKLMÅD", FKVAKT, FKFORS, FKENH FROM BBB.EGDTA.FAKSTAP1

      WHERE (FKFKDT BETWEEN 20100701 AND 20100731 or FKFKDT BETWEEN 20110701 AND 20110731) AND not FKPRC = '149' AND not FKPRC = '141' AND FKKCRN = '1' AND not FKKKT = '9';

       

       

      LEFT JOIN (FAKSTAP1)

      ODBC CONNECT TO [MS Access Database;DBQ=C:\Documents and Settings\BBB.AAA\Skrivebord\Skrivebord\QV\QV.accdb];

      LOAD FIRMA, FKSAG, Ordredato, Ordre_TID;

      SQL SELECT * FROM tbl_Ordrenr;

        • Left join
          Sunil Chauhan

          ODBC CONNECT TO EGDTA;

          EGDTA:

          LOAD FKFIRM As FIRMA, FKPRC, FKKUNR, FKFKDT, FKSAG, FKFKNR, FKAN, FKVAGR, FKVANR, FKFBEL, FKKBEL, FKKMPG, FKKKT As Konteringskode, FKLAG, FKSLG As `Sælger`, FKRDGL, FKSPRM As `Pristilsætning`, FKSAGB As Sagsbehandler,"FKLMÅD" As LevMaadeKode, FKVAKT As Varekontering, FKFORS As Forsendelseskode, FKENH;

          SQL SELECT FKFIRM, FKPRC, FKKUNR, FKFKDT, FKSAG, FKFKNR, FKAN, FKVAGR, FKVANR, FKFBEL, FKKBEL, FKKMPG, FKKKT,FKLAG, FKSLG, FKRDGL, FKSPRM, FKSAGB, "FKLMÅD", FKVAKT, FKFORS, FKENH FROM BBB.EGDTA.FAKSTAP1

          WHERE (FKFKDT BETWEEN 20100701 AND 20100731 or FKFKDT BETWEEN 20110701 AND 20110731) AND not FKPRC = '149' AND not FKPRC = '141' AND FKKCRN = '1' AND not FKKKT = '9';

           

           

          ODBC CONNECT TO [MS Access Database;DBQ=C:\Documents and Settings\BBB.AAA\Skrivebord\Skrivebord\QV\QV.accdb];

          LEFT JOIN (FAKSTAP1)

          LOAD FIRMA, FKSAG, Ordredato, Ordre_TID;

          SQL SELECT * FROM tbl_Ordrenr;

           

           

          try out this if not work then take resident of first table and then left join resident second table

           

           

          thanks

          Sunil Chauhan