• SELECT first_appointment.*, next_appointment.*

    FROM (

    SELECT customer#, MIN(appoinment_date) AS appointment_date

    FROM table_name

    GROUP BY customer#

    HAVING MIN(appointment_date) >= '20140101' AND MIN(appointment_date) < '20140901'

    ) AS first_appointment

    CROSS APPLY (

    SELECT TOP (1) next.*

    FROM table_name next

    WHERE next.customer# = first_appointment.customer# AND

    next.appointment_date > DATEADD(DAY, DATEDIFF(DAY, 0, first_appointment.appointment_date) + 30, 0)

    ORDER BY next.appointment

    ) AS next_appointment

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.