Im trying to manage next thing
Table 1 (Season)
ID | startdate | End date | description
1 2006-09-01 | 2007-08-31 | Season 2007
2 2007-09-01 | 2008-08-31 | Season 2008
3 2008-09-01 | 2009-08-31 | Season 2009
4 2009-09-01 | 2010-08-31 | Season 2010
Table 2 (Products)
ID | productname | date
1 | Product A | 2008-04-14 |
2 | Product B | 2007-08-25 |
3 | Product C | 2009-07-01 |
Now I want to make a query that gives the right Season for these products. So when date is for example 2007-09-15 then this is a product of season 2008 because the date is in the range 2007-09-01 till 2008-08-31 in the first table.
So query should be look like this
ID | productname | date | Season
1 | Product A | 2008-04-14 | Season 2008
2 | Product B | 2007-08-25 | Season 2007
3 | Product C | 2009-09-11 | Season 2010
thanks
Table 1 (Season)
ID | startdate | End date | description
1 2006-09-01 | 2007-08-31 | Season 2007
2 2007-09-01 | 2008-08-31 | Season 2008
3 2008-09-01 | 2009-08-31 | Season 2009
4 2009-09-01 | 2010-08-31 | Season 2010
Table 2 (Products)
ID | productname | date
1 | Product A | 2008-04-14 |
2 | Product B | 2007-08-25 |
3 | Product C | 2009-07-01 |
Now I want to make a query that gives the right Season for these products. So when date is for example 2007-09-15 then this is a product of season 2008 because the date is in the range 2007-09-01 till 2008-08-31 in the first table.
So query should be look like this
ID | productname | date | Season
1 | Product A | 2008-04-14 | Season 2008
2 | Product B | 2007-08-25 | Season 2007
3 | Product C | 2009-09-11 | Season 2010
thanks