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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:13:26+00:00 2026-06-16T07:13:26+00:00

We have date columns in our database that are just a day – like

  • 0

We have date columns in our database that are just a day – like birth date. However, SQL Server stores them as a date & time and the time in the records has various values (no idea how it ended up that way).

The problem is people will run a query for all birthdates <= {some date} and the ones that are equal aren’t returned because a DateTime (using ADO.NET) set to a given date has a time of midnight.

I understand what’s going on. The question is how best to handle this. We could force in a time of 23:23:59.999999999 to the date but that feels like it would have problems.

What’s the standard best practice for handling this?

  • 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-16T07:13:27+00:00Added an answer on June 16, 2026 at 7:13 am

    Simply add 1 day to {some_date} and use a less than comparison. Just make sure it’s the next day at 12am…

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

Sidebar

Related Questions

I have a client supplied file that is loaded in to our SQL Server
I have a table that has three different date columns, so I set each
I have table of 5000+ rows and 8+ columns like, Station Lat Long Date
I have designed database tables (normalised, on an MS SQL server) and created a
Our program ships with an SQL Server 2005 database and SQL Server 2005 Express.
I have a table named CUSTOMERS with the following columns : CUSTOMER_ID (NUMBER), DAY(DATE),
SQL Server 2005. In our application, we have an entity with a parent table
I have a data frame of daily data: df with four columns: Date, A,
i have three columns for Date In, Date Out, Total Days. If in Date
I have table with one of the columns as date in 'YYYY-MM-DD' format. Can

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.