I seen this problem here and repliesd, mightn’t be right for them but hopefully helps, even if not in MS SQL but just the logic to offset