>>There won't be any NULLs without a LEFT JOIN. Otherwise it will only return those that have a matching record in the Orders table.
>>
>>
>>SELECT ;
>> Orders.Id, ;
>> NVL(Clients.ClientName, PADR("Sir/Madam", nn)) AS ClientName ;
>> FROM Orders LEFT JOIN Clients ON Orders.Id = Clients.Order_id;
>> INTO CURSOR Temp ;
>> ORDER BY.....
>
>There will if the client table has stored .NULL. in the name.
>I assumed that was the situation, since you wouldn't need to have a "Dear Sir/Madam" for a customer that had no order...
Trey,
I really should have said "have a matching record in the _Clients_ table."
Sherry has an ORder_id in the clients table which means that she's keeping a name for each order, or not as the case may be.
Most of us would have the client being the parent and insist on having a client set up before they could place an order, but she may have a system where they are "cash" customers and don't always get all the client details - though I don't know how you would send out a letter without details.
Maybe Sherry should re-assess her design if things aren't too far along.