spalmateer
Registered User.
- Local time
- Today, 04:59
- Joined
- Dec 5, 2000
- Messages
- 46
Hi,
I'm in the process of creating a search form for my database. Works great but its showing multiple lines for each customer in the result. Is there a way I can modify this to eliminate duplicate customers in the results. I've tried SELECT DISTINCT but that doesn't work.
SELECT [tblCustomer].[CustomerID], [tblCustomer].[CompanyName], [tblCustomer].[LastName], [tblCustomer].[FirstName], [tblCustomer].[Address1], [tblCustomer].[Address2], [tblCustomer].[City], [tblCustomer].[PostalCode], [tblCustomer].[HomePhone], [tblCustomer].[Model], [tblCustomer].[Builder],[tblOrderDetail].[ProductID], [tblOrderDetail].[SerialNumber]
FROM (tblCustomer INNER JOIN tblOrder ON [tblCustomer].[CustomerID]=[tblOrder].[CustomerID]) INNER JOIN tblOrderDetail ON [tblOrder].[InvoiceID]=[tblOrderDetail].[InvoiceID]
WHERE ([tblCustomer].[Model] Like [Forms]![frmSearch]![Model] Or [Forms]![frmSearch]![Model] Is Null) AND ([tblCustomer].[PostalCode] Like [Forms]![frmSearch]![txtPostalCode] Or [Forms]![frmSearch]![txtPostalCode] Is Null) AND ([tblOrderDetail].[ProductID] Like [Forms]![frmSearch]![ProductID] Or [Forms]![frmSearch]![ProductID] Is Null) AND ([tblOrderDetail].[SerialNumber] Like [Forms]![frmSearch]![SerialNumber] Or [Forms]![frmSearch]![SerialNumber] Is Null)
Any help would be appreciated!
Scott
[This message has been edited by spalmateer (edited 05-03-2002).]
I'm in the process of creating a search form for my database. Works great but its showing multiple lines for each customer in the result. Is there a way I can modify this to eliminate duplicate customers in the results. I've tried SELECT DISTINCT but that doesn't work.
SELECT [tblCustomer].[CustomerID], [tblCustomer].[CompanyName], [tblCustomer].[LastName], [tblCustomer].[FirstName], [tblCustomer].[Address1], [tblCustomer].[Address2], [tblCustomer].[City], [tblCustomer].[PostalCode], [tblCustomer].[HomePhone], [tblCustomer].[Model], [tblCustomer].[Builder],[tblOrderDetail].[ProductID], [tblOrderDetail].[SerialNumber]
FROM (tblCustomer INNER JOIN tblOrder ON [tblCustomer].[CustomerID]=[tblOrder].[CustomerID]) INNER JOIN tblOrderDetail ON [tblOrder].[InvoiceID]=[tblOrderDetail].[InvoiceID]
WHERE ([tblCustomer].[Model] Like [Forms]![frmSearch]![Model] Or [Forms]![frmSearch]![Model] Is Null) AND ([tblCustomer].[PostalCode] Like [Forms]![frmSearch]![txtPostalCode] Or [Forms]![frmSearch]![txtPostalCode] Is Null) AND ([tblOrderDetail].[ProductID] Like [Forms]![frmSearch]![ProductID] Or [Forms]![frmSearch]![ProductID] Is Null) AND ([tblOrderDetail].[SerialNumber] Like [Forms]![frmSearch]![SerialNumber] Or [Forms]![frmSearch]![SerialNumber] Is Null)
Any help would be appreciated!
Scott
[This message has been edited by spalmateer (edited 05-03-2002).]