Asger Blond
ab-mi at post3.tele.dk
Thu Jul 17 17:56:14 CDT 2008
Chester, My previous posting had a closing parenthesis in the code, which should be omitted - This is supposed to work: INSERT INTO [tbl Wells on SCADA] (Wellname) SELECT DISTINCT [qry Water Injectors on SCADA].Wellname FROM [qry Water Injectors on SCADA] WHERE [qry Water Injectors on SCADA].Wellname NOT IN (SELECT Wellname FROM [tbl Wells on SCADA]); Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] På vegne af Kaup, Chester Sendt: 17. juli 2008 23:08 Til: Access Developers discussion and problem solving Emne: [AccessD] Query gives duplicate records This query asks for a value for [tbl Wells on SCADA]![Wellname]. INSERT INTO [tbl Wells on SCADA] ( Wellname ) SELECT DISTINCT [qry Water Injectors on SCADA].Wellname FROM [qry Water Injectors on SCADA] WHERE ((([qry Water Injectors on SCADA].Wellname)<>[tbl Wells on SCADA]![Wellname])); If I modify the query like this I don't get asked for [tbl Wells on SCADA]![Wellname] but I get duplicate records. INSERT INTO [tbl Wells on SCADA] ( Wellname ) SELECT DISTINCT [qry Water Injectors on SCADA].Wellname FROM [qry Water Injectors on SCADA], [tbl Wells on SCADA] WHERE ((([qry Water Injectors on SCADA].Wellname)<>[tbl Wells on SCADA]![Wellname])); What am I doing wrong here. Thanks. Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com