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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:30:32+00:00 2026-05-21T03:30:32+00:00

I’m facing a strange query result and I want to ask you why I’m

  • 0

I’m facing a strange query result and I want to ask you why I’m facing this issue.

I store some datetime data into TestTable as following :

creation_time
-----------------------
2010-07-10 00:01:43.000
2010-07-11 00:01:43.000
2010-07-12 00:01:43.000

This table is created and filled as following :

create table TestTable(creation_time datetime);
Insert into  TestTable values('2010-07-10 00:01:43.000');
Insert into  TestTable values('2010-07-11 00:01:43.000');
Insert into  TestTable values('2010-07-12 00:01:43.000');

when I execute this query , I get two rows only instead of three as I expected:

SELECT *  FROM TestTable
WHERE  creation_time BETWEEN  CONVERT(VARCHAR(10),'2010-07-10',111) -- remove time part
                     and      CONVERT(VARCHAR(10),'2010-07-12',111) -- remove time part  

Or if I execute this query , the same issue ..

SELECT *  FROM TestTable
WHERE  CONVERT(datetime,creation_time,111) BETWEEN  CONVERT(VARCHAR(10),'2010-07-10',111) -- remove time part
                                              and      CONVERT(VARCHAR(10),'2010-07-12',111) -- remove time part

My Question :

  • Why the last row (‘2010-07-12 00:01:43.000’) does not appear in
    the result even if I set the date range to cover all the day from 2010-07-10 to 2010-07-12?
  • I use Sql server 2005 express edition with windows xp 32-bits.
  • I’m trying to don’t use a workaround solution such as increasing the date range to cover additional day to get the days I want.

Thanks .

  • 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-21T03:30:33+00:00Added an answer on May 21, 2026 at 3:30 am

    You need to remove the time part from creation_time as well. Just use the same CONVERT if it works.

    Currently you’re asking if 2010-07-12 00:01:43.000 is less than 2010-07-12 00:00:00.000, which is not true.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I want to construct a data frame in an Rcpp function, but when I
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I am currently running into a problem where an element is coming back from

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.