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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-10-13 : 08:03:34
|
| Krishna writes "i want to pick a row which fall between two dateslike :hotelCode -roomcode -StayStartdate -StayEndDate --- Price1001 101 01-Oct-2005 30 Nov 2005 100 Rs1001 101 01-Dec-2005 31 Dec 2005 200 Rs1002 103 01-Oct-2005 30 Nov 2005 150 Rs1003 104 03 Dec 2005 31 Dec 2005 200 Rs suppose any one want to stay 30 Nov to 2 Dec for this i want only first two records because rest of not fall in this category.Because 1002 stayEndDate is 30 Nov and i003 has staystartdate is 3 dec Please suggestThanks" |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2005-10-13 : 08:11:12
|
| Hi You can use between clause .. try searching for the between on book online .. you will be better samples which suits what you want.Complicated things can be done by simple thinking |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-10-13 : 08:55:49
|
| Is this?Select Columns from yourTable where StayStartdate <='30-Nov-2005' Or StayEndDate <='31 Dec 2005'MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|