How move data into a temp table from two tables using the innerjoin

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Netcrawlerrr

    How move data into a temp table from two tables using the innerjoin

    Hi there,

    I have a tricky one.....(For me that is.)

    I am trying to move data into a temp table, but the date comes from 2 tables using the innerjoin method.

    Here is the code I have so far:

    INSERT INTO TempTable (SELECT Distinct PlakkerData.Lid no, PlakkerData.Dep Name, LedeData.POBOX, LedeData.STREET , LedeData.CITY, LedeData.ZIP, CAST(PlakkerDat a.KorrCode AS varchar(2)) AS KorrCode, PlakkerData.Kor rDate, CAST(LedeData.A ANTAFH AS VARCHAR(2)) AS AANTAFH, LedeData.LIDTIP E, LedeData.TAAL, CAST(DATEADD(ye ar, 21, CONVERT(datetim e, PlakkerData.Geb Dat, 101)) AS varchar(12)) AS gebdat FROM PlakkerData LEFT OUTER JOIN LedeData ON PlakkerData.Lid no = LedeData.LIDNO WHERE (PlakkerData.Ko rrCode = 89) AND (LedeData.Check Audit = 0))
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    That's a LEFT JOIN... Try replacing LEFT OUTER with INNER.

    Happy Coding!!!

    ~~ CK

    Comment

    Working...