Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Including the unfound records

Author  Topic 

Saeed
Starting Member

39 Posts

Posted - 2002-12-19 : 17:44:12
I have been trying to include all the records that are found in another table (based on 2 columns) in another table...


INSERT INTO txtReportSlow (MCCN, MCCDescription, AICRate, BWTorGSM,
Width, WarehouseN, Warehouse, SumOfRollWeight,
SumOfWeightused, MaxOfDateReceived, MaxOfDateUsed, UserID,JobAllocList)
select distinct A.MCCN, A.MCCDescription,A. AICRate, A.BWTorGSM,
A.Width, A.WarehouseN, A.Warehouse, A.SumOfRollWeight,
A.SumOfWeightused, A.LastReceipt, A.LastIssue, @UserID,''
from #Report As A Inner join Materialplan as B on
A.MCCN = B.MCCN AND A.WareHouseN =B.SiteID



I have also been trying to include all therecords that are NOT found
in the same table using various option


....saeme as above+
from #Report As A Inner join Materialplan as B on
A.MCCN <> B.MCCN AND A.WareHouseN <>B.SiteID

but this option does not seem to do what i think should be done.
I still find MCCN and SIteIDs that are found in both tables (Material Plan and txtReportSlow....?????

What i m doing wrong here please....







ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2002-12-19 : 18:39:07
http://www.sqlteam.com/item.asp?ItemID=448

Go to Top of Page
   

- Advertisement -