Viewing 15 posts - 31 through 45 (of 4,086 total)
I'll guess since you didn't post a way for anyone to post tested code.
Use LEAD to access subsequent data in the current row. Then compare AgentExpDate to the LEAD...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
Do it in the other order. Use UPDATE to update the records using the OUTPUT clause to output your required fields.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
Did you try:
Select 'Restored' as source, AppUser.UserId, usergroup.Name, AppUser.UserName
from AppUser
INNER JOIN RestoredDatabase.dbo.AppUser_UserGroup
ON AppUser.UserId = AppUser_UserGroup.UserId
INNER JOIN RestoredDatabase.dbo.UserGroup
...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
Viewing 15 posts - 31 through 45 (of 4,086 total)