Having trouble creating a form - need some advice...

asked 2015-12-05 20:32:58 +0200

noalig gravatar image

I have a table for transactions, which is linked to a table of clients via a "CustomerID" field. In creating a form to enter the transaction, I would like to have a dropdown list of customer names from the Customers table, from which the selected name would result in the CustomerID being captured in the transaction input form.

I created a list box trying to use the following sql:

SELECT DISTINCT "CustomerID" || ' - ' || "Last Name" || ', ' || "First Name", "Last Name" AS "Client" FROM "TableCustomers" Where "Active" = 1 Order by "Client" ASC

It doesn't return any entries.

Where have I gone wrong?

edit retag flag offensive close merge delete

Comments

SELECT DISTINCT "CustomerID" || ' - ' || "Last Name" || ', ' || "First Name", "Last Name" AS "Client" , "CustomerID" FROM "TableCustomers" Where "Active" = 1 Order by "Client" ASC

Mano Engel gravatar imageMano Engel ( 2015-12-08 22:46:53 +0200 )edit