Kaup, Chester
Chester_Kaup at kindermorgan.com
Wed May 4 10:50:19 CDT 2005
The following append query works fine: INSERT INTO [tbl Cum Oil Test] ( [Well Name], [Date], [Cum Oil] ) SELECT [tbl Monthly Oil Test].[Well Name], [tbl Monthly Oil Test].Date, [tbl Cum Oil Test]![Cum Oil]+[tbl Monthly Oil Test]![Prod Oil] AS [New Cum] FROM [tbl Monthly Oil Test], [tbl Cum Oil Test] WHERE ((([tbl Monthly Oil Test]![Well Name])=[tbl Cum Oil Test]![Well Name])); However if I change the query as follows it will not run. I get a message of "You tried to execute a query that does not include the specified expression 'Well Name' as part of an aggregate function". Is it not possible to do this in one query? INSERT INTO [tbl Cum Oil Test] ( [Well Name], [Date], [Cum Oil] ) SELECT [tbl Monthly Oil Test].[Well Name], Max([tbl Monthly Oil Test].Date), [tbl Cum Oil Test]![Cum Oil]+[tbl Monthly Oil Test]![Prod Oil] AS [New Cum] FROM [tbl Monthly Oil Test], [tbl Cum Oil Test] WHERE ((([tbl Monthly Oil Test]![Well Name])=[tbl Cum Oil Test]![Well Name]));