sysadmin42
Technical User
- May 6, 2005
- 138
Everything works fine in the below statement, except that the [~Clients].State field, because it's a lookup, only shows the ID number of the state, rather than its value in the States table. Any thoughts?
Code:
SELECT [~Clients].[First Name], [~Clients].[Last Name], [~Clients].Address1, [~Clients].Address2, [~Clients].City, [~Clients].State,[~Clients].Zip
FROM [~Clients]
INNER JOIN states
ON [~Clients].State=[states].ID
WHERE (([~Clients].MailingList)=Yes AND ([~Clients].Address1)<>NULL)
UNION SELECT [Contacts-Other].[First Name], [Contacts-Other].[Last Name], [Contacts-Other].[Address1], [Contacts-Other].[Address2], [Contacts-Other].[City], [Contacts-Other].[State], [Contacts-Other].[Zip]
FROM [Contacts-Other]
INNER JOIN states
ON [Contacts-Other].State=[states].id
WHERE (([Contacts-Other].MailingList)=Yes AND ([Contacts-Other].Address1)<>NULL)
UNION SELECT [~Clients].[Other First Name],[~Clients].[Other Last Name],[~Clients].Address1, [~Clients].Address2, [~Clients].City, [~Clients].State, [~Clients].Zip
FROM [~Clients]
INNER JOIN states
ON [~Clients].State=[states].id
WHERE (([~Clients].MailingListOtherContact)=Yes AND ([~Clients].[Other First Name])<>NULL);