i trying run left join in ms access sql. trying left join "oldpe" table new "1 pe" table , update column labeled "line num". there no primary key in these tables linking them through series of conditions. here code far (excuse poor formatting new , still learning sql).
update [1 pe] left join oldpe on ([1 pe].sumres = oldpe.sumres) , ([1 pe].[project code] = oldpe.[project code]) , ([1 pe].[deptid] = oldpe.[deptid]) , ([1 pe].[res code] = oldpe.[res code]) , ([1 pe].[explain cost] oldpe.[explain cost]) , ([1 pe].notes oldpe.notes) set [1 pe].[line num] = [oldpe].[line num];
there lot of rows have null or blank values in "explain cost" , "notes" columns. used statement because of notes want vary due spelling mistakes , such. use "like" won't return rows null value these columns. sql code wont accept exists (i may writing wrong).
how these null values still returned while using command
use isnull join original value if null. (this include null values in results.)
, ([1 pe].[explain cost] isnull(oldpe.[explain cost],[1 pe].[explain cost]))
Comments
Post a Comment