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

  • Home
  • SEARCH
  • 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 6165923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:15:01+00:00 2026-05-23T22:15:01+00:00

I’m trying to return some data based on a series of weeks. This is

  • 0

I’m trying to return some data based on a series of weeks. This is going to be for an SSRS report.

For example, I need to return all rows which are dated from 3rd July to 9th July inclusive (Sun-Sat), name it Week 1 of the month. Then 10th Jul to 16th July, which is Week 2, and so forth. The hardest part is having it continue on between months. For example, 26th June to 2nd July.

I’m sure I can use DATEPART to do this somehow, but really have no idea how. Can someone offer assistance?

Thank you in advance.

  • 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-23T22:15:01+00:00Added an answer on May 23, 2026 at 10:15 pm

    DATEPART(week, DateField) will give you the week of the year, which will cover your criteria. Week of the month is not a great criteria to use since it’s so amorphous.

    You can get the week of the year for the first of the month by returning DATEPART(week, '7/1/2011') or whatever, which will give you a starting point.

    EDIT:

    For your additional criteria from the comments:

    SELECT <fields>
    FROM MyTable
    WHERE YEAR(DateField) = 2011
    AND DATEPART(week, Datefield) BETWEEN 
        DATEPART(week, '6/1/2011') AND DATEPART(week, (DATEADD(DAY, -1, (DATEADD(Month, 1,     '6/1/2011')))))
    

    You may want to check the closing parentheses count, but basically this says:

    • Year 2011
    • Week of 6/1/2011 through Week of 6/30/2011

    The extra date calculations are to get to 7/1/2011 (month +1) then back a day to 6/30/2011. The alternative is to hardcode date breaks for each month. This way you can also paramterize the dates and concatenate like

    CAST(@Month + '/1/' + @Year as smalldatetime)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is

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.