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

The Archive Base Latest Questions

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

Via a stored procedure in SQL Server 2008 , I am trying to show

  • 0

Via a stored procedure in SQL Server 2008, I am trying to show the number of transactions from the past 7 days, and then compare those numbers to a 7 day period a year ago. Additionally, I’d like to be able to show month-to-date versus month-to-date a year ago. Or this month to last month. Etc. Essentially, time-series data.

I’ve got a table with all the individual transactions. The two options I can think of are:

  1. Calculate each individual day or month and return the result set
    at run time.

  2. Calculate each invididual day and put the result
    into a table. Update that daily. Create another table for weeks.
    Another table for months. Each day, add a record or update the
    existing record. That certainly will make the query faster, since
    the data is already calculated. However, if I had to make updates to previous days (taking into account returns/cancels)

Note: This is an internal application, so it won’t see thousands of requests a minute.

What is the best way to return this type of data?

The other alternative I’ve thought about is using HBase OpenTSDB via Option 2, but seems like it’s the same process.

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

    I may be either misunderstanding the question, or need to see your table schema (or something similar), but I see this as a simple SELECT COUNT(*)...WHERE DATE BETWEEN [2Dates]. If all you need to do is count transactions that is.

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

Sidebar

Related Questions

I use the following stored procedure from my SQL Server 2008 database to return
I'm need to write a stored procedure for SQL Server 2008 for performing a
I have a SQL Server 2008 stored procedure that updates values in a table.
I have a SQL Server 2008 database. This database has a stored procedure that
I have a stored procedure in SQL Server that returns some data via a
I am working on a stored procedure in SQL Server 2008 for resetting an
I am creating a stored procedure in SQL Server via SSMS. I have written
we are trying to create C# CLR Stored Procedure on a SQL Server 2005
I have a stored procedure running on sql server 2008 looping over a table
I am trying to run a stored procedure on my SQL server. I think

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.