Mark A Matte
markamatte at hotmail.com
Tue Apr 7 08:39:52 CDT 2009
Why not do it all in 1 statement..."Select a.testfield from (select testfield from testtable) a" Mark A. Matte > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester > Sent: Monday, April 06, 2009 1:03 PM > To: Access Developers discussion and problem solving > Subject: [AccessD] Using recordset in a query > > I am trying to use the following query but am getting no records returned. Can this be done or am I approaching this all wrong? > > Set RS1 = MyDb.OpenRecordset(strSql) > > strSql = "SELECT dbo_DSS_StatusChanges.PID, RS1.Fields(1), " & _ "dbo_DSS_StatusChanges.StatusDate, dbo_DSS_StatusChanges.Status " & _ > "FROM RS1 INNER JOIN dbo_DSS_StatusChanges ON " & _ > "(RS1.Fields(3) = dbo_DSS_StatusChanges.StatusDate) AND " & _ > "(RS1.Fields(0) = dbo_DSS_StatusChanges.PID) " & _ > "GROUP BY dbo_DSS_StatusChanges.PID, RS1.Fields(1), " & _ "dbo_DSS_StatusChanges.StatusDate, dbo_DSS_StatusChanges.Status;" > > Chester Kaup > Engineering Technician > Kinder Morgan CO2 Company, LLP > Office (432) 688-3797 > FAX (432) 688-3799 > > _________________________________________________________________ Windows Live™: Keep your life in sync. http://windowslive.com/explore?ocid=TXT_TAGLM_WL_allup_1a_explore_042009