>Hello all.
>
>I am designing a find form for my application that allows a user to search for customers based on one criteria or many criteria. The problem that I am having is that I have 2 tables that are related based on cust_id. The customer.dbf has one record per customer but the billing.dbf can have many records per customer. What I want to be able to do is not only query on cust_id or last_name or first_name etc or any combination but also be able to query on what customer is assigned a certain acct_id from the billing.dbf. Right now I use 1 select statement that I build at runtime that queries the customer.dbf. I want to be able to query customer.dbf and billing.dbf at the same time or with multiple select statements and the result be a list of customers who meet those criteria. Any and all information would be helpful. Thanks in advance.
>
>customer.dbf
>-----------------------
>cust_id
>last_name
>first_name
>address1
>address2
>city
>state
>zip
>
>
>billing.dbf
>-----------------------
>cust_id
>acct_id
>description
>amount
Select distinct c.*, b.acct_id from customer c,billing b where c.cust_id=b.cust_id and (c.last_name=srchlname and c.first_name=srchfname and b.acct_id=srchacct)