Click here to Skip to main content
15,891,910 members
Articles / Programming Languages / SQL

Accurate DATETIME Range Searching in SQL Server

16 Feb 2016CPOL 6.3K   3   1
You can also get the correct result by passing time along with the date.ExampleIf you have to search records between 1st Apr 2010 and 5th Apr 2010, then:Select * from TableNameWhere DateField Between '04/01/2010 00:00:00' And '04/01/2010 23:59:59'
Only logged in members can view this content

Please go to the SQL Table of Contents to view the list of available articles in this section.
Closed because this item's quality is too poor to be published. Reported by Sascha Lefèvre, Richard Deeming, Kornfeld Eliyahu Peter, OriginalGriff, Wendelius on Tuesday, February 16, 2016 5:53am