Query based on two tables
Posted on 2007-03-20
I'm new to SQL so please help me. I need to write a query based on 2 tables. First table is "tblRecords" it contains the following fields:
UserID (number) , WeekID (number) , Approved (yes/no)
The second table is called "tblWeeks" and it contains:
WeekID (total of 4 weekIDs starting from 1-4), Week (description of the job in that week)
What I need to do is to create a query that would display a recordset based on users, putting each user in one row and have 4 approved fields for each week based on the weekID so it should look something like this:
User | Approved for Week1 | Approved for Week2 | Approved for Week3 | Approved for Week4 |
user1 1 1 0 0
user2 1 0 1 0
and so on....
please help me out on this thanks!