Hi Guys, I was wondering if there is any way to solve this problem.
I have two tables in my db.
tbl1 has fields name, qty, date
tbl2 has fields start date, end date, classification
eg
tbl1
xxx 2 12/03/03
yyy 4 01/04/04
tbl2
11/29/03 12/31/03 j11
01/01/04 02/02/04 f01
What I need to do is design a query that returns
name, qty, classification.
resulting query should look like
xxx 2 j11
yyy 4 f01
the problem I'm having is getting the classification field. what I need is some sort of statement that compares the date field in tbl1 with the start and end dates in tbl2 and selects the corresponding classification.
something like if ([date] between [start date] and [end date], [classification], "No Match")
Any help will be much appreciated.
Thanks a lot
I have two tables in my db.
tbl1 has fields name, qty, date
tbl2 has fields start date, end date, classification
eg
tbl1
xxx 2 12/03/03
yyy 4 01/04/04
tbl2
11/29/03 12/31/03 j11
01/01/04 02/02/04 f01
What I need to do is design a query that returns
name, qty, classification.
resulting query should look like
xxx 2 j11
yyy 4 f01
the problem I'm having is getting the classification field. what I need is some sort of statement that compares the date field in tbl1 with the start and end dates in tbl2 and selects the corresponding classification.
something like if ([date] between [start date] and [end date], [classification], "No Match")
Any help will be much appreciated.
Thanks a lot