I have multiple tables I'm going to be putting into a query, but I'm getting stuck on one thing.
I have a main table called 'tblEvent' with data similar to the following:
eventID | eventCheck1 | eventCheck2
123 | 0 | 0
124 | 1 | 0
125 | 0 | 1
126 | 1 | 1
...which is related to a table called 'tblEventCheck' displaying the following data:
eventCheckCheckedYes | eventCheckDesc1 | eventCheckDesc2
1 | Description1 | Description2
For the problem I'm having with this particular query, I need to be able to select all the data from 'tblEvent' and display it, whether or not all the 'eventCheckDesc's' are empty (because there are a ton of other things in the table that will display outside of this issue).
Here's what I got from playing around with some queries:
Giving me the following output:
eventID | eventCheck1 | eventCheck2 | eventCheckDesc1 | eventCheckDesc 2
123 | 0 | 0 | |
124 | 1 | 0 | |
125 | 0 | 1 | |
126 | 1 | 1 | Description1 | Description1
...This is not what I want because the 'AND' in the SQL statement only displays if both match.
I need it to look like this for the output:
eventID | eventCheck1 | eventCheck2 | eventCheckDesc1 | eventCheckDesc 2
123 | 0 | 0 | |
124 | 1 | 0 | Description1 |
125 | 0 | 1 | | Description2
126 | 1 | 1 | Description1 | Description1
I have not been able to find anything out on the web with this particular issue. I've tried playing around with wizard with no avail, as well as changing the nested LEFT JOIN's without using the 'AND' or 'OR' statement to no avail.
Someone please help! Thanks in advance for anyone you can give me a swift kick in the right direction.
By the way I'm using Access 2007.
Thanks
I have a main table called 'tblEvent' with data similar to the following:
eventID | eventCheck1 | eventCheck2
123 | 0 | 0
124 | 1 | 0
125 | 0 | 1
126 | 1 | 1
...which is related to a table called 'tblEventCheck' displaying the following data:
eventCheckCheckedYes | eventCheckDesc1 | eventCheckDesc2
1 | Description1 | Description2
For the problem I'm having with this particular query, I need to be able to select all the data from 'tblEvent' and display it, whether or not all the 'eventCheckDesc's' are empty (because there are a ton of other things in the table that will display outside of this issue).
Here's what I got from playing around with some queries:
Code:
SELECT tblEvent.eventID, tblEvent.eventCheck1, tblEvent.eventCheck2, tblEventCheck.eventCheckCheckedYes, tblEventCheck.eventCheckDesc1, tblEventCheck.eventCheckDesc2
FROM tblEvent LEFT JOIN tblEventCheck ON (tblEvent.eventCheck1 = tblEventCheck.eventCheckCheckedYes) AND (tblEvent.eventCheck2 = tblEventCheck.eventCheckCheckedYes)
eventID | eventCheck1 | eventCheck2 | eventCheckDesc1 | eventCheckDesc 2
123 | 0 | 0 | |
124 | 1 | 0 | |
125 | 0 | 1 | |
126 | 1 | 1 | Description1 | Description1
...This is not what I want because the 'AND' in the SQL statement only displays if both match.
I need it to look like this for the output:
eventID | eventCheck1 | eventCheck2 | eventCheckDesc1 | eventCheckDesc 2
123 | 0 | 0 | |
124 | 1 | 0 | Description1 |
125 | 0 | 1 | | Description2
126 | 1 | 1 | Description1 | Description1
I have not been able to find anything out on the web with this particular issue. I've tried playing around with wizard with no avail, as well as changing the nested LEFT JOIN's without using the 'AND' or 'OR' statement to no avail.
Someone please help! Thanks in advance for anyone you can give me a swift kick in the right direction.
By the way I'm using Access 2007.
Thanks