Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

Fetching logic after converting into Date?

$
0
0

Hi,

I have a column Date1 which is a DATETIME datatype.
First i give the following line in where clause
"Date1   between '2014-05-05 00:00:00' and '2014-05-05 00:00:00'"
After this it fetches only those rows where Date1 exactly is 2014-05-05 00:00:00
Then I issue the following line in the where clause
"CONVERT(DATE,Date1,103)   between '2014-05-05 00:00:00' and '2014-05-05 00:00:00' "
How come after converting it into date it fetches all the values that fall on 2014-05-05
even though the time is hard coded in the between as 00:00:00

Thanks and Regards


Regards


Viewing all articles
Browse latest Browse all 8428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>