Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
gmunky
Starting Member
5 Posts |
Posted - 2007-04-04 : 15:05:30
|
| I'm working with a table with records that contain dates in this format: (YYYY-MM-DD hh:ii:ss). I need to be able to retrieve records that are between two given dates(begin date & end date):let's say the given dates are begin date: 2007-03-22 15:00:00end date: 2007-03-23 23:00:00I want to be able to retrieve the records that satisfy the date range.example:Date--------------------2007-03-22 13:30:002007-03-23 09:30:002007-03-23 13:30:002007-03-23 15:30:002007-03-26 13:30:00i want the records that have these dates :2007-03-23 09:30:002007-03-23 13:30:002007-03-23 15:30:00Thanks for the help!! |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-04-04 : 15:07:15
|
| SELECT * FROM Table1WHERE Date >= '2007-03-22 15:00:00' AND Date < '2007-03-23 23:00:00'Peter LarssonHelsingborg, Sweden |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-04-05 : 01:00:50
|
| orbetween '2007-03-22 15:00:00' AND '2007-03-23 23:00:00'MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|