>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...
Insanity: Doing the same thing over and over and expecting different results.