Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP5 - Select SQL
Message
From
14/03/1997 02:25:20
Larry Long
ProgRes (Programming Resources)
Georgia, United States
 
 
To
13/03/1997 13:06:57
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00024127
Message ID:
00024200
Views:
41
>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)
L.A.Long
ProgRes
lalong1@charter.net
Previous
Reply
Map
View

Click here to load this message in the networking platform