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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:31:37+00:00 2026-05-31T08:31:37+00:00

I have data sorted by dates: e.g. Region – Date – Count East –

  • 0

I have data sorted by dates:

e.g.
Region – Date – Count
East – 2012/01/01 – 5
West – 2012/01/01 – 2
East – 2012/01/06 – 3
South – 2012/01/07 – 3
etc

I’m trying to create a sum of the Counts, grouped by date groups relative to today. So for example

Assuming today was 2012/01/07:

  • Yesterday is defined to be from Today – 1 to today (non-inclusive of
    today)
  • Week is defined to be from Today – 7 to today (non-inclusive of
    today)
  • Month is defined to be from Today – 28 to today (non-inclusive
    of today)

The output in the matrix for the sample data would be:

enter image description here

As a bonus, ideally I’d have a 5th column that’s for “On Demand” Start and End date range for the user to input.

I think the key is to add an EXPR in the Column Group’s Group On property but I don’t know what the Expression should be.

Any help would be great!

  • 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-31T08:31:38+00:00Added an answer on May 31, 2026 at 8:31 am

    Personally I think I would prefer to attack it in the SQL query. So for example

    SELECT 
     CASE WHEN DATEDIFF(day, GETDATE(), DateColumn) = 0 THEN SomeColumn ELSE 0 END cToday
     CASE WHEN DATEDIFF(day, GETDATE(), DateColumn) = 1 THEN SomeColumn ELSE 0 END cYesterday
     CASE WHEN DATEDIFF(day, GETDATE(), DateColumn) > 0 AND 
               DATEDIFF(day, GETDATE(), DateColumn) < 8 THEN SomeColumn ELSE 0 END cWeek
     CASE WHEN DATEDIFF(day, GETDATE(), DateColumn) > 0 THEN SomeColumn ELSE 0 END cMonth
    FROM 
     SomeTable
    WHERE 
     DateColumn > DATEADD(day, -28, GETDATE())
    

    Otherwise you could use a similar approach inside SSRS

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

Sidebar

Related Questions

I have a table of data sorted by date, from which a user can
i have a long list selector in which i'm displaying data sorted by date.
I have a table that has data like below(sorted by date) COL_A | COL_B
I have data in an MYSQL database that looks like this: Project Date Time
I have an ordered (i.e. sorted) list that contains dates sorted (as datetime objects)
my report is generating data that is supposed to be sorted by date and
I have data stored in a csv file that looks like this: Date,BLOCK,,Wood,Miscellaneous,,Totals,MO Saturday,4055-RU,4055-AR,4091,1139,1158,,100
I have a query that produces a result like this: The data is sorted
i have data in a datatable that needs to be sorted on the first
Using Core Data, I have my fetchedResultsController with a with a date field. I

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.