David McAfee
davidmcafee at gmail.com
Thu Aug 6 16:36:11 CDT 2009
I think it may have something to do with that DistinctRow Can you select only the specific PKIDs then delete those records from the table? Warning OTTOMH: DELETE [tbl Inactive Injectors Any Day Prior Month] WHERE PID IN (SELECT PID FROM [tbl Inactive Injectors Any Day Prior Month] INNER JOIN [tbl Statuses During Prior Month] ON [tbl Inactive Injectors Any Day Prior Month].PID = [tbl Statuses During Prior Month].PID WHERE ((([tbl Statuses During Prior Month].Status) In ("FL","FM","FH","SL","SM","SH","SP","PL","PM","PH","RP","RM","RH","RL","TA","WD","WC","WF","WCH","WAGW","WAGC"))); On Thu, Aug 6, 2009 at 2:25 PM, Kaup, Chester <Chester_Kaup at kindermorgan.com > wrote: > DELETE DISTINCTROW [tbl Inactive Injectors Any Day Prior Month].*, [tbl > Statuses During Prior Month].Status > FROM [tbl Inactive Injectors Any Day Prior Month] INNER JOIN [tbl Statuses > During Prior Month] ON [tbl Inactive Injectors Any Day Prior Month].PID = > [tbl Statuses During Prior Month].PID > WHERE ((([tbl Statuses During Prior Month].Status) In > ("FL","FM","FH","SL","SM","SH","SP","PL","PM","PH","RP","RM","RH","RL","TA","WD","WC","WF","WCH","WAGW","WAGC"))); > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto: > accessd-bounces at databaseadvisors.com] On Behalf Of David McAfee > Sent: Thursday, August 06, 2009 4:18 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Delete query problem > > Post the SQL. > > > > > > > > On Thu, Aug 6, 2009 at 2:06 PM, Kaup, Chester < > Chester_Kaup at kindermorgan.com > > wrote: > > > I have a simple delete query. When I open the query in design mode and > > click on view it shows 69 records that will be deleted. This is the > correct > > number. When I run the query it only wants to delete 29 records. A > compact > > and repair and restart did nothing. I have never seen this before. Your > > ideas? > > > > > > 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 > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com >