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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:19:54+00:00 2026-05-29T08:19:54+00:00

I generate an Excel using an SQL query per each day: SELECT COUNT(res_id) as

  • 0

I generate an Excel using an SQL query per each day:

SELECT      COUNT(res_id) as TotalReservation
FROM        bup_vw_res_reservation
WHERE       res_deleted = 0 
AND         DATEPART(DAY,res_date_start) = 1

I execute this Query each time I want to change the DAY. To generate 1 sheet in my Excel file, I need to open and close 30 connections in my page. And if I need to make another sheet for a different company ,then I need to execute the same 30 query again. And the page becomes extremely slow 🙁

Is there another way to get the same result in 1 query ?

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

    If you need the total, you could do

    DATEPART(DAY, res_date_start) BETWEEN 1 AND 30
    

    If you need each reservation count for each day, do this

    SELECT      COUNT(res_id) as TotalReservation, DATEPART(DAY,res_date_start)
    FROM        bup_vw_res_reservation
    WHERE       res_deleted = 0 
    GROUP BY    DATEPART(DAY,res_date_start)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm doing updates from Excel/CSV files to a database. I'm using LINQ to SQL
I am using flexcel component to generate Excel files from Delphi 2007. Now we
I would like to generate an Excel file using a database query in VB.Net.
We're currently using a thing from SoftArtisans to generate Excel spreadsheets from data the
I'm using C# to generate new files from Excel's Template.xlsm workbook. Some sheets of
I generate an excel file using XML format outlined on stackoverflow in the following
I generate some png charts and excel files using a mysql database. I display
Using ColdFusion and Microsoft SQL we are exporting data to an Excel Spreadsheet using
I need to display the newly generated excel (from tables using Apache POI) in
We are trying to generate an excel sheet using a template. Normally we would

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.