Click here to Skip to main content
15,888,610 members
Articles / Programming Languages / SQL

Accurate DATETIME Range Searching in SQL Server

Rate me:
Please Sign up or sign in to vote.
3.75/5 (4 votes)
9 Dec 2009CPOL 18.6K   10  
When searching between datetimes in SQL(or SQL in a Stored Proc) we can't just do:select * from where CreateTime >= @DateFrom and CreateTime <= @DateToIf your search is date inclusive and you're not concerned with time, which most users aren't, then you need to add a little extra...

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer Currently working on projects for May Gurney
United Kingdom United Kingdom
Areas of expertise: c#, asp.net, design patterns, GUI useability/layout

Comments and Discussions