dndaughtery
Programmer
I have been able to select the records I need to update using the following Select statement:
Select *
From Rejects inner join Card on Rejects.CardID = Card.CardID
where RIGHT(Card.AccountNumber,6) in (SELECT RIGHT(RWMSMO,6)from Table1)AND Rejects.SentToCollections is null And Rejects.Collection = -1 And rejectamount in (SELECT RWCKAMT From Table1)
Group By RIGHT(Card.AccountNumber,6), Rejects.rejectID
Order By RIGHT(Card.AccountNumber,6) DESC
Will the following update update the records from the previous select statement?
Update Rejects
Set SentToCollections = GetDate()-1
From Rejects inner join Card on Rejects.CardID = Card.CardID
where RIGHT(Card.AccountNumber,6) in (SELECT RIGHT(RWMSMO,6)from Table1)AND Rejects.SentToCollections is null And Rejects.Collection = -1 And rejectamount in (SELECT RWCKAMT From Table1)
Group By RIGHT(Card.AccountNumber,6), Rejects.rejectID
Order By RIGHT(Card.AccountNumber,6) DESC
Also, what's the SQL Statement to rollback the update if it messes up everything?
Select *
From Rejects inner join Card on Rejects.CardID = Card.CardID
where RIGHT(Card.AccountNumber,6) in (SELECT RIGHT(RWMSMO,6)from Table1)AND Rejects.SentToCollections is null And Rejects.Collection = -1 And rejectamount in (SELECT RWCKAMT From Table1)
Group By RIGHT(Card.AccountNumber,6), Rejects.rejectID
Order By RIGHT(Card.AccountNumber,6) DESC
Will the following update update the records from the previous select statement?
Update Rejects
Set SentToCollections = GetDate()-1
From Rejects inner join Card on Rejects.CardID = Card.CardID
where RIGHT(Card.AccountNumber,6) in (SELECT RIGHT(RWMSMO,6)from Table1)AND Rejects.SentToCollections is null And Rejects.Collection = -1 And rejectamount in (SELECT RWCKAMT From Table1)
Group By RIGHT(Card.AccountNumber,6), Rejects.rejectID
Order By RIGHT(Card.AccountNumber,6) DESC
Also, what's the SQL Statement to rollback the update if it messes up everything?