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 |
|
khufiamalik
Posting Yak Master
120 Posts |
Posted - 2008-09-02 : 00:53:03
|
| Hello All,Please Correct the Given below Query, Actually I want to select date between start date and end date of another table select * from LEV_Employee_Leaves_Detailwhere Leave_Date between select Start_Date AND End_Date from CLT_Client_MonthThanks In Advance |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
khufiamalik
Posting Yak Master
120 Posts |
Posted - 2008-09-02 : 01:09:29
|
| There is only one row in this table |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-09-02 : 01:31:21
|
| You could put the values into variables first and then just use the variables in the BETWEEN or:WHERE Leave_Date >= (SELECT Start_Date FROM CLT_Client_Month) AND Leave_Date <= (SELECT END_DATE FROM CLT_Client_Month)You could get fancier, but I'd just go with the variable approach.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog |
 |
|
|
|
|
|