Why does my left join in Access have fewer rows than the left table?

前端 未结 4 1861
挽巷
挽巷 2021-01-19 10:48

I have two tables in an MS Access 2010 database: TBLIndividuals and TblIndividualsUpdates. They have a lot of the same data, but the primary key may not be the same for a gi

4条回答
  •  爱一瞬间的悲伤
    2021-01-19 11:24

    ON ( 
    
            TblIndividuals.FirstName = TblIndividualsUpdates.FirstName
    
            and 
    
            TblIndividuals.LastName = TblIndividualsUpdates.LastName
    
            AND (
                     TblIndividuals.DateBorn = TblIndividualsUpdates.DateBorn      
                     or 
                     (
                         TblIndividuals.DateBorn is null          
                         and 
                         (
                         TblIndividuals.MidName is null 
                         and TblIndividualsUpdates.MidName is null              
                         or TblIndividuals.MidName = TblIndividualsUpdates.MidName
                         )
                     )
                 )
        );
    

    What I would do is systematically remove all the join conditions except the first two until you find the records drop off. Then you will know where your problem is.

提交回复
热议问题