I have a batch of 12 csv files, one for each month. What I'm trying to do is amalgamate them all into one file with no duplicate data.
So, I've started in July 09 and created a master sheet. Then I want to query June 09 and only withdraw the records that don't match a column in the master sheet.
I've tried:-
but it still returns records that so match the Master.PlanNumber column.Code:SELECT DISTINCT `June 2009`.CRMContactId, `May 2009`.ContactName `May 2009`.ClientName, `May 2009`.SchemeName, `May 2009`.IORef, `May 2009`.Provider, `May 2009`.PlanType, `May 2009`.PlanNumber, `May 2009`.LeadPractitionerName FROM `May 2009.csv` `May 2009`, `Master Sheet.csv` `Master` WHERE (`May 2009`.ContactName='Policy Check') AND (`May 2009`.PlanNumber Not In (`Master`.PlanNumber))
I've also tried using a subquery :-
and that returns no records when there are some that aren't in the master sheet.Code:Not In (SELECT `Master`.PlanNumber FROM `Master Sheet.csv` Master)
Any ideas how I can achieve this?



LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks