Update table with is not null condition

  • Hi,

    I have two tables in Access DB and I'm trying to update them with is not null condition and I am using this below query and it doesn't work.

    UPDATE [Application] INNER JOIN [Contacts] ON [Application].[Code] = [Contacts].[Code]

    SET [Application].[Lead] = [Contacts].[Lead]

    where [Application].[Lead] IS NOT NULL

    Is there any way to have is not null condition inside set and also I would need to update lot of column with same condition.

    Really appreaciate any help on this.

  • It appears that query should work, and what it would do would be to populate the [Lead] column in the Application table with the value of the matching record in the Contacts table [Lead] column if the [Lead] column in the Application table contains some data. Is that what you really want?

    The more common situation is to update the Application.Lead column where it contains no data, but if you have a situation where the Contacts table has been updated, and the Application table has not, then your query would be useful. One way to debug this sort of query is to run it as a select query first so you get the set of data you are after, and then change it to an update query.

    Wendell
    Colorful Colorado
    You can't see the view if you don't climb the mountain!

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply