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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:46:14+00:00 2026-06-06T08:46:14+00:00

Okay, so. I’ve got a database which has a column of timestamps. The start

  • 0

Okay, so. I’ve got a database which has a column of timestamps. The start of the “day” is 7am. So, say for today, it would start at 0700 on 6/25/12, and end at 0700 on 6/26/12. I’m needing to do calculations within that 24 hour time span. Now, I’m thinking of doing a query that gets all information starting at 0700 + 24 hours, but I’m not 100% on how to phrase said query. Thanks for any and all help.

  • 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-06-06T08:46:15+00:00Added an answer on June 6, 2026 at 8:46 am

    Caveat – code done from the top of my head, without Visual Studio, and without proper error handling, but this should show you how to set the necessary parameter values correctly, using a parameterized query. This may contain syntax errors, but again, it should show you enough to get you going. I added comments to explain the relevant code.

    private System.Data.DataTable ExecuteSql(DateTime BusinessDate)
    {
    
        System.Data.DataTable ReturnValue = new System.Data.DataTable;
        string sql = "Select * From myTable WHERE TimestampColumn >= @StartDate AND TimestampColumn < @EndDate";
        System.Data.OleDb.OleDbCommand cmd = new System.Data.OleDb.OleDb.Command(connectionString, sql);
    
        // For start date, we can't assume the user has passed in a date with a 
        // midnight time, so first, use DateTime.Date to get JUST the date at midnight, 
        // then add 7 hours to get to the desired start time.
        // For example, if the calling code had passed in 1/1/2001 8:00 AM we would use
        // the .Date property to get it to 1/1/2001 12:00 AM
        // and then add 7 hours.
    
        cmd.Parameters.Add(@StartDate, BusinessDate.Date.AddHours(7));
    
        // The end date - same logic, but instead of adding 7 hours, add 31 
        // (24 hours + 7 hours = 31 hours)
    
        cmd.Parameters.Add(@EndDate, BusinessDate.Date.AddHours(31));  // 24 + 7
        System.Data.OleDb.OleDbDataAdapter ad = new System.Data.OleDb.OleDbDataAdapter(cmd);
        ad.Fill(ReturnValue)    
    
        return ReturnValue;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, I have GOT to be missing something totally rudimentary here. I have an
Okay so say I have a form element like this: HTML: <div class=form-item> <label>Current
Okay so my question is this. Say I have a simple C++ code: #include
Okay, I've set up a bit of code which searching for all the pages
Okay say your using a app, and you opened a new activity and then
Okay here is my url: http://example.com/home/process_login I would like to replace the underscore with
Okay so here is my database: I have a page on my .net form
Okay I got some good advice for Mobile Detection but still having an issue
Okay, so I'm running a small test webserver on my private network. I've got
Okay I have a list of devices where i can select which to edit.

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.