Under your math you are assuming a 1 to 1 relationship between orders
and Custromers. Unless you are running a scam, where no customer would
ever by from you twice, that is not case, the whole reason you have 2
seperate tables. Hope thats makes sense.

Adam H



On Tue, 30 Nov 2004 12:18:23 -0500, Che Vilnonis <[EMAIL PROTECTED]> wrote:
> Adam/Dov
> 
> Using your query my recordcount is off.
> 
> Actual # of customer ids from my customers table = 865.
> Actual # of customer ids from my orders table = 596.
> 
> Using your query, the difference = 335.
> 
> 865 - 596 should = 269. What am I missing? Debug info is below.
> 
> -----------------------------------------------------
> 
> getCustsFromCusts (Records=865, Time=0ms)
> SQL =
> SELECT  CustID
> FROM    Customers
> 
> getCustsFromOrders (Records=596, Time=15ms)
> SQL =
> SELECT  CustID
> FROM    Orders
> 
> getCustsNoOrder (Records=335, Time=16ms)
> SQL =
> SELECT  CustID
> FROM    Customers
> WHERE   CustID NOT IN (Select CustID From Orders)
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:185691
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to