Kaup, Chester
Chester_Kaup at kindermorgan.com
Wed Mar 18 09:22:27 CDT 2009
Never mind. Figured it out. Got to use a sub query. ________________________________ From: Kaup, Chester Sent: Wednesday, March 18, 2009 9:16 AM To: 'Access Developers discussion and problem solving' Subject: Count problem in query When I execute the following query it returns 341 records. SELECT DISTINCT [tbl Status During Prior Month].PID FROM [tbl Status During Prior Month] WHERE ((([tbl Status During Prior Month].Status) In ("RP","RM","RH","SP","SM","SH","PL","PM","PH"))) GROUP BY [tbl Status During Prior Month].PID; When I execute the following query it returns a count of 540 SELECT DISTINCT Count([tbl Status During Prior Month].PID) AS CountOfPID FROM [tbl Status During Prior Month] WHERE ((([tbl Status During Prior Month].Status) In ("RP","RM","RH","SP","SM","SH","PL","PM","PH"))); Why is the count not 341? 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.