Here's the query I used. The problem with it is it doesn't return to me ALL the records in the FreshJobs table and I need it to, evenif there are no matching records in InvHistoryDetail. The speed is excellent for as much as the query does.
FJMain.Query3.Close;
FJMain.Query3.SQL.Clear;
FJMain.Query3.SQL.Add('Select FreshJobs.*, InvHistoryDetail.*');
FJMain.Query3.SQL.Add('from FreshJobs');
FJMain.Query3.SQL.Add('Inner Join InvHistoryDetail on concat(FreshJobs.AdNumber,''05'')=InvHistoryDetail.MillerAdNumber');
FJMain.Query3.SQL.Add('where FreshJobs.FJInvoiceDate=? and');
FJMain.Query3.SQL.Add(' InvHistoryDetail.AncillaryType=15');
FJMain.Query3.SQL.Add(' Order by FreshJobs.AdExec, FreshJobs.ClientNumber,FreshJobs.AdNumber');
FJMain.Query3.Params[0].asDate := BilledDate;