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 644647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:24:57+00:00 2026-05-13T21:24:57+00:00

Given a month and year, how do I know the dates for a day

  • 0

Given a month and year, how do I know the dates for a day in that month.

e.g. Given month = Feb, year = 2010. I need to find the sunday dates in the month

The expected output is:

07/02/2010
14/02/2010
21/02/2010
28/02/2010

How to do so?

  • 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. Editorial Team
    Editorial Team
    2026-05-13T21:24:58+00:00Added an answer on May 13, 2026 at 9:24 pm

    Have a look at something like

    DECLARE @Month VARCHAR(3),
            @Year INT
    
    SELECT  @Month = 'Feb',
            @Year = 2010
    
    DECLARE @RunDate DATETIME
    
    SELECT @RunDate = '01 ' + @Month + CAST(@Year AS VARCHAR(4))
    
    ;WITH DATES AS(
            SELECT  @RunDate DateVal,
                    DATENAME(dw, @RunDate) DateNameVal
            UNION ALL
            SELECT  DateVal + 1,
                    DATENAME(dw, DateVal + 1)
            FROM Dates
            WHERE DATEPART(month,DateVal) = DATEPART(month,DateVal + 1)
    )
    SELECT  *
    FROM    DATES
    WHERE   DateNameVal = 'Sunday'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given <xsl:variable name=datePrecision as=element()*> <p>Year</p> <p>Month</p> <p>Day</p> <p>Time</p> <p>Timestamp</p> </xsl:variable> The expression $datePrecision[5] returns
I need to get the last day of the month given as a date
I'm having this problem right now: given a month and a year, I'd need
I want find all Saturdays and Sundays in A given month. How can I
I need to check whether a given date is in the preceding month for
I know that this question was asked a million times, I just can't find
Possible Duplicate: PHP iterate days of month given month and year Obtain all days
How can one select the first day of the month of a given DateTime
Given the following array: var dates = ['2012-10-01', '2012-10-02', '2012-10-03', '2011-01-01', '2011-01-02', '2011-06-03', '2010-09-01',
In Unix, I want to find the date (day of month) of the last

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.