Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

select query with date column

$
0
0

Hi,

We are using sql server 2005. Table called 'Transaction' has column called changeDateTime which is of DateTime type. When ever transaction gets changed from front end, this column gets populated like this: 2014-03-16 18:50:15.300

When I do a select query like this

Declare @startDate DateTime, @endDate DateTime

SET @startDate = '2013-09-16'

SET @endDate = '2014-09-16'

select * from Transaction where changeDateTIme >= @startDate and changeDateTime <= @endDate

This doesn't pick up the transaction with 2014-03-16 18:50:15.300. I have to add a day to @endDate to be picked up.  I want the transactions that are modified only 16th. I even tried between. Still the same.

I appreciate your response.

Thanks,

Spunny


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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