Joe Yoder wrote on 2015-05-18: > I have a ledger table with about 23,000 records and a category table with > about 150 records. Both tables have an integer iCat_Id field which I use in > the following code: > SELECT led.iCat_Id, ddate, Led.iCat_Id, cCategory; > FROM Led, Cat; > WHERE Cat.iCat_Id = Led.iCat_Id > The select comes back with about one third of the cCategory description > fields empty. > > I searched for a specific value of iCat_Id in a browse and found the same > value for records that included the description as well as the ones that do > no include the description. > > I thought perhaps VFP sees a difference between the values that work and > the ones that don't so I scrolled through the file and compare iCat_id_a > with iCat_Id_b with a "? iCat_Id_a = iCat_Id_b". The results were alway > true. > > I tried reindexing the tables and restarting VFP but the behavior persists. > > Any suggestion will be welcome. > > Thanks in advance, > > Joe
Joe, > SELECT led.iCat_Id, ddate, Led.iCat_Id, cCategory; > FROM Led, Cat; > WHERE Cat.iCat_Id = Led.iCat_Id The iCat_ID is being pulled from the Led table only. Which would explain your comparison. I believe by default the FROM Led, Cat is an implicit LEFT JOIN. You'll get all the records from LED, and only matching records from CAT. If the second iCat_Id was pulling from Cat, it would probably be blank the same time cCategory is. HTH, Tracy Tracy Pearson PowerChurch Software _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

