Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 137565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:07:34+00:00 2026-05-11T07:07:34+00:00

This is locale specific to the US wherein it considered that the start of

  • 0

This is locale specific to the US wherein it considered that the start of a week is Sunday; I want to be able to ask SQL to give me the date of the next Sunday relative to today [getDate()]. If today is Jan 15 it should return Jan 18; if today were Sunday it should return the following Sunday which is the 25th. This would be trivial to write a UDF for but I was curious if anyone had other tricks/ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T07:07:35+00:00Added an answer on May 11, 2026 at 7:07 am
    DECLARE @d AS datetime SET @d = '1/15/2009' PRINT @d PRINT DATEADD(day, 8 - DATEPART(weekday, @d), @d) SET @d = '1/18/2009' PRINT @d PRINT DATEADD(day, 8 - DATEPART(weekday, @d), @d)  -- So it should be able to be used inline pretty efficiently: DATEADD(day, 8 - DATEPART(weekday, datecolumn), datecolumn)  -- If you want to change the first day for a different convention, simply use SET DATEFIRST before performing the operation -- e.g. for Monday: SET DATEFIRST 1 -- e.g. for Saturday: SET DATEFIRST 6  DECLARE @restore AS int SET @restore = @@DATEFIRST SET DATEFIRST 1  DECLARE @d AS datetime SET @d = '1/15/2009' PRINT @d PRINT DATEADD(day, 8 - DATEPART(weekday, @d), @d) SET @d = '1/19/2009' PRINT @d  PRINT DATEADD(day, 8 - DATEPART(weekday, @d), @d) SET DATEFIRST @restore 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to be able to format the double price to a locale specific
Wikipedia says that locale dictates a set of formatting rules for a specific language/region
Given that this field locale have been set for norwegian bokmål and norway: Locale
I want to calculate the monday of a specific week number of a year.
According to this site: http://iosdevelopertips.com/cocoa/date-formatter-examples.html there is a class that handles formatting, which takes
Nothing I've found has been able to help me solve this one specific case.
I have a .js.erb file in my assets directory. This reads some locale specific
In C++, I can set the current locale like this: std::locale::global(std::locale(name)) But how can
In my interface I'm showing the display name of a locale with this: [[NSLocale
I can output a locale sensitive time format using strftime('%X') , but this always

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.