query a recordset

SamDeMan

Registered User.
Local time
Today, 17:01
Joined
Aug 22, 2005
Messages
182
Hi

How do i query an open recordset. currently i have a query and then i have another query that queries it.

i will post the query and the recordset SQL

thanks,

sam


this is the query:
Code:
SELECT DISTINCT PPYearlyIndex.PgpPayGroup, PPYearlyIndex.PgpPeriodStartDate, PPYearlyIndex.PgpPeriodEndDate

FROM PPYearlyIndex

WHERE (((PPYearlyIndex.PayperiodIndex) Between [Forms]![RetentionAllFrm]![cboPayperiodIndexStart] And [Forms]![RetentionAllFrm]![cboPayperiodIndexEnd]) AND ((PPYearlyIndex.PayperiodYear) Between [Forms]![RetentionAllFrm]![cboPayperiodYearStart] And [Forms]![RetentionAllFrm]![cboPayperiodYearEnd]));

now i have this recordset in my VBA:

Code:
    strSQL = "SELECT PPAllFctsRetentionQry.PgpPayGroup, Min(PPAllFctsRetentionQry.PgpPeriodStartDate) AS FirstStartDate, Max(PPAllFctsRetentionQry.PgpPeriodStartDate) AS LastStartDate, Min(PPAllFctsRetentionQry.PgpPeriodEndDate) AS FirstEndDate, Max(PPAllFctsRetentionQry.PgpPeriodEndDate) AS LastEndDate " & _
            " FROM PPAllFctsRetentionQry GROUP BY PPAllFctsRetentionQry.PgpPayGroup;"
 

Users who are viewing this thread

Back
Top Bottom