[AccessD] Query not working as expected.

Kaup, Chester Chester_Kaup at kindermorgan.com
Mon Feb 13 12:48:44 CST 2012


I have the following query. The table tbl Injection Profiles to Run has 142 records. The query is only returning 40 records. If I remove the criteria all 142 records are returned. Can I not use a criteria this way? Here is the SQL. Thanks.

SELECT [tbl Injection Profiles to Run].WellNumber, 
[tbl Injection Profiles to Run].[Test Date], 
Min(Switches.Switch_Date) AS MinOfSwitch_Date
FROM Switches 
RIGHT JOIN [tbl Injection Profiles to Run] 
ON Switches.Well = [tbl Injection Profiles to Run].WellNumber
GROUP BY [tbl Injection Profiles to Run].WellNumber, 
[tbl Injection Profiles to Run].[Test Date]
HAVING (((Min(Switches.Switch_Date))>[tbl Injection Profiles to Run]![Test Date]+365));

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.




More information about the AccessD mailing list