sql - Access, Update Query that does not overwrite data with blank cells -


with update query, how can prevent overwriting data in existing rows blank cells?

update tbl1 inner join tbl2  on tbl1.thing0 = tbl2.thing0  set tbl2.[thing1] = tbl1.[thing1], tbl2.[thing2] = tbl1.[thing2], tbl2.[thing3] = tbl1.[thing3]; 

i have users on-site updating table in real time , worry remote users updating table once have connection overwrite on-site users data bunch of blank cells.

will work if add end?

where not null; 

edit1 hansup

empty in case means on row1 of tbl1 where, onsite user entered data in columns 2 through 7(things redacted in code above). offsite user has entered nothing in row today. offsite user uses query above update tbl1. since columns 2 through 7 empty on table, don't want work overwrite onsite user's edits blank cells.

edit2 hansup , luk2302

each row project. projects created 1 user, multiple users update projects on life. picture row 1, thing1, customer name has been entered. now, onsite user makes updates. offsite user makes none row, runs update query.

offsite user's update should add info existing rows, not remove data. if overwrites data data, i'm fine that. recording contact info , when milestones reached. long data gets there. i'm not worried inputs it.

excuse formatting, i'm answering phone...

you replace elements of set such that, example:

set tbl2.[thing1] = iif(tbl1.[thing1] null, tbl2.[thing1], tbl1.[thing2])

in way, if new value null other value used.

be aware of possible different behavior of null , empty string, depending on use case... can change condition check empty string too.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -