Updating records with a join.

  • In Access I would use the statement:

    UPDATE tblSite INNER JOIN tblSiteReview ON tblSite.tblSitePK = tblSiteReview.tblSiteFK SET tblSiteReview.blnNonCompliant = True

    WHERE (((tblSite.intStatus)=2) AND ((tblSiteReview.dtmReviewDate)>[tblSiteReview].[dtmExpDate]));

    How would I run the same statement in SQL Server?

     

    Thanks!

  • UPDATE tblSiteReview

    set tblSiteReview.blnNonCompliant = 1

    from tblSite inner join tblSiteReview on tblSite.tblSitePK = tblSiteReview.tblSiteFK

    where (((tblSite.intStatus)=2) AND ((tblSiteReview.dtmReviewDate)>[tblSiteReview].[dtmExpDate]))

    If the phone doesn't ring...It's me.

  • UPDATE tblSiteReview SET tblSiteReview.blnNonCompliant = True

    from tblSite,tblSiteReview--,INNER JOIN tblSiteReview ON tblSite.tblSitePK = tblSiteReview.tblSiteFK

    WHERE (((tblSite.intStatus)=2) AND ((tblSiteReview.dtmReviewDate)>[tblSiteReview].[dtmExpDate]))

    JR

  • Thanks!

Viewing 4 posts - 1 through 3 (of 3 total)

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