I am using LO 4.0 to create an invoice database. I want the invoice entry form to be able to have a drop down list where the employee can choose from either the name or the business name that the invoice will be billed to. The Name is a concatenated result of joining First Name and Last Name fields from the Contacts table, and Business Name is another field on the contacts table, both have associated ContactID’s. I have tried several different ways using queries and views and combining queries and no luck. My two most promising so far have been:
- A Union ALL:
SELECT “NAME”, “ContactID” FROM “vwFirstNameLastNameJoin” UNION ALL SELECT “NAME”, “ContactID” FROM “vwBusinessNameFromContacts”
This displayed the concatenated “NAME” from the first-last name join I did and the contact ID’s only (shows ALL contact IDs), it shows no Business Names.
- I tried a LEFT OUTER JOIN
SELECT * FROM { OJ “vwFirstNameLastNameJoin” LEFT OUTER JOIN “vwBusinessNameFromContacts” ON “vwFirstNameLastNameJoin”.“ContactID” = “vwBusinessNameFromContacts”.“ContactID” }
and it produced 4 columns instead of 2.
How do I get it to produce a column of all the ContactID’s along with the corresponding ‘NAME’ (First and Last combined) AND OR the Business Name associated with that ID? OR does anyone have any other suggestion? ContactID is a required field and a PK, If I put 2 boxes on the form, one for name and one for business name it won’t let me bypass the Name box to get to Business Name because ContactID is required. I’d rather not have to have 2 separate but identical forms, one for customers and one for business customers.
I am developing business databases that I plan to offer to the Open Source community when complete to help more businesses make the switch to Linux. Any help would be greatly appreciated.