>Hi,
>
>I have to create a SQL Passthrough in which the WHERE clause filters if the days passed between a date in one record to the date in the previous record are greater than let say 10 days, within a specific grouping of records.
>
>Any ideas?
>
>
>Thanks, J
Assuming you decide previous, next record based on dates:
select distinct a.myDate as FirstDate, b.myDate as NextDate,
days = DateDiff(day,a.myDate, b.myDate)
from myDates a inner join mydates b
On b.myDate = (Select Min(myDate) from myDates c where c.myDate > a.myDate)
where DateDiff(day,a.myDate, b.myDate) > 10
Cetin