Hi All,
can i know the sql query to find first sunday and second sunday of the month
Hi All,
can i know the sql query to find first sunday and second sunday of the month
select top 2 cast(y.y as DATE)
from
(
select top 31 ROW_NUMBER() over(order by a.object_id) x
from sys.objects a
) x
outer apply
(
select DATEADD(day, x.x, dateadd(day,-day(getDate()), getDate())) y
)y
where DATEPART(weekday,y.y) = 1
order by y.y