Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Accurate DATETIME Range Searching in SQL Server

, 9 Dec 2009
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...

License

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

About the Author

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

| Advertise | Privacy | Mobile
Web02 | 2.8.140709.1 | Last Updated 9 Dec 2009
Article Copyright 2009 by Mark Graham
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid