General information
Category:
Coding, syntax & commands
>I'm wondering if I need to get so complicated for this. All I need is a list of clients and their paysources that appear in either the ver table or the bal table. Since both tables have both client number and paysource in them, do I even really need to use the clients table at all?
Ah-ha! Right you are. You only need to select from the two tables that have billable clients in them, since you don't care about clients (in the Clients table) that are not billable. So, all you need is a single join:
SELECT DISTINCT Client_num, Client_SRC, FName, LName ;
FROM Ver ;
UNION ;
SELECT DISTINCT Client_num, Client_SRC, FName, LName ;
FROM Bal ;
INTO CURSOR Billable_Clients
Again, the UNION will filter any rows that appear in both tables. This should be acceptably fast, too. Oh, I like it. Let us all know if this doesn't give you the right results.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only