Hi,
I need to find the number of Mondays within a given date range.
Example: How many Mondays between 01/01/2006 and 06/30/2006.
Any suggestions on how to do this?
Jimdeclare @.date1 datetime set @.date1 = '20061001'
declare @.date2 datetime set @.date2 = '20061029'
declare @.anyMonday datetime set @.anyMonday = '19000102'
select
datediff(day,@.anyMonday,@.date2)/7 -
datediff(day,@.anyMonday,@.date1)/7 as MondayBetween
<Jim.Mueksch@.wellsfargo.com> wrote in message
news:1161982195.940615.282480@.k70g2000cwa.googlegroups.com...
> Hi,
>
> I need to find the number of Mondays within a given date range.
> Example: How many Mondays between 01/01/2006 and 06/30/2006.
> Any suggestions on how to do this?
>
> Jim
>sql
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment