$ 0 0 To exclude cancelled payments add the following to your WHERE clause: and ISNULL(T0.Canceled,'N') <> 'Y'