Show rows with a blank field

rc-alex

Registered User.
Local time
Today, 10:17
Joined
Apr 29, 2011
Messages
106
Hello,

I searched but didn't find exactly this.

I have a query that should show me this:

Customer Location Division Corp_Parent
xxx.........xxxx.......xxxxx....xxxx
yyy........yyyy..................yyyy
zzz.........zzzz
aaa........aaaa..................aaa
bbb........bbb........bbbb.....bbb

However, if the Division or Corp Parent are blank, they are ommitted from the query results. How can I show them regardless of blank values? Tried a couple of things but they gave me no results.

Thanks
 
So it would appear you have two tables involved so you would use an OUTER JOIN to the table which has Division and Corp_Parent.
 
So it would appear you have two tables involved so you would use an OUTER JOIN to the table which has Division and Corp_Parent.

Bob,
Actually 4 tables.

tbl_customer
tbl_location
tbl_division
tbl_corporate

While the customer table has lookup fields to tie the customer to a location, division, and/or parent, the information (address, etc) of each of these entities is stored in its own table. I think this is also necessary because a division must also be tied to a specific coporate, etc., for filtering purposes.

Please correct me if I am wrong.

Thanks
 
Okay, what you need is to use outer joins from the customer table to whichever is applicable. However, it may be a problem with the lookups at table level if you don't use the right field from the right table. Since the lookup is in the Customer Table, you would select the CustomerID from the Customer table and then the Location, Division, and Corporate from their respective tables. Don't select them from the Customers table.
 

Users who are viewing this thread

Back
Top Bottom