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 |
|
viguro
Starting Member
12 Posts |
Posted - 2008-04-30 : 14:33:28
|
| Hello all,I have a table (tbl_a) with 2 columns: itemNames | Date .ItemNames can have duplicates.I have another table (tbl_b) with date ranges in 2 columns: startDate | endDate.what I would like to do is: query tbl_a where date between startDate and endDate of tbl_b.does anyone have an idea?thanks in advance. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-04-30 : 14:48:04
|
| SELECT DISTINCT a.itemNamesFROM tbl_a aINNER JOIN tbl_b bON a.Date >= b.StartDateAND a.Date <= b.endDate |
 |
|
|
viguro
Starting Member
12 Posts |
Posted - 2008-04-30 : 15:21:14
|
| it works like a charm! thanks a bunch visakh16! |
 |
|
|
|
|
|