NTSPL Blog logo
NTSPL Insights

Find first sunday of the month in SQL Server

02 Aug 2013
Share

It required check Sunday when you generate installment schedule using Store Procedure.


declare @sun datetime
set @sun=DATEADD(Month, DATEDIFF(Month, 0, GETDATE()) + 0, 0) +
6 - (DATEPART(Weekday,DATEADD(Month,DATEDIFF(Month,0, GETDATE()) + 0, 0))
+ @@DateFirst + 5) % 7

print @sun

Share

Recent Posts

Laravel in 2026 – Features, Benefits, Use Cases & Why Businesses Choose Laravel.

Laravel in 2026: Why It’s Still the #1 PHP Framework for Scalable,...

18 Apr 2026
Predictive Auto-Scaling in 2026: How AI is Transforming Cloud Performance & Cost Optimization.

Predictive Auto-Scaling in 2026: How AI is Transforming Cloud Performance & Cost...

14 Apr 2026
Cloud vs Dedicated Servers in 2026

Cloud vs Dedicated Servers in 2026: Choosing the Right Infrastructure for High-Performance...

10 Apr 2026
Together We Travel, Together We Grow NTSPL Family Office Outing to Barikul Resort, Chilika.

Together We Travel, Together We Grow NTSPL Family Office Outing to Barikul...

31 Mar 2026
AI in 2026

AI in 2026: Key Strategies Enterprises Must Get Right for Future Success.

20 Mar 2026
facebook icon twitter icon instagram icon youtube icon youtube icon
  • Home
  • About Us
  • Career
  • Contacts
  • Privacy Policy
  • Term & Conditions
Copyright © 2022 NTSPL. All Rights Reserved.