Skip to content

Commit

Permalink
sql fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hkf-tech committed Sep 8, 2021
1 parent b273c2a commit ce0a70c
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
-- Update TermsAndConditionsAcceptedOn for all users created afer 27th July 2021
Update [employer_account].[User]
Set TermAndConditionsAcceptedOn = GETDATE()
where Id in (
Select UserId from (
-- Update TermsAndConditionsAcceptedOn for all users created afer 28th July 2021
Update U
Set U. TermAndConditionsAcceptedOn = T.CreatedDate
From [employer_account].[User] U
Inner join (
Select UserId, CreatedDate from (
Select *, ROW_NUMBER() over (partition by M.UserId order by M.CreatedDate) As Rank2
from [employer_account].[Membership] M
) Result
Where Result.Rank2 = 1
and CreatedDate >= CONVERT(DATETIME,'27/07/2021',103) --dd/MM/yyyy
)
and CreatedDate >= CONVERT(DATETIME,'28/07/2021',103) --dd/MM/yyyy
) T on U.Id = T.UserId

0 comments on commit ce0a70c

Please sign in to comment.