Home Forums Article Discussions Article Discussions by Author Discuss content posted by Jack To Find the First Saturday of any month RE: To Find the First Saturday of any month
nigel.
SSChampion
Points: 11636
More actions
August 11, 2009 at 9:32 am
#1037521
Just worked out an alternative that avoids one of the the modulus operations
SELECT firstsaturday = DATEADD(dd,
(14 - @@DATEFIRST - DATEPART(dw,DATEADD(month,DATEDIFF(mm,0,somedate),0)))%7,
DATEADD(month,DATEDIFF(mm,0,somedate),0))
NigelHow to post questions