When I use the statement below I get an errorSELECT BillingTransactionIndex, CreateDate, UserType, UserIndex, TransType, Reference, Total, Balance, (SELECT Balance AS Expr1 FROM dbo.BillingTransactions2 WHERE (UserIndex = T.UserIndex) AND (BillingTransactionIndex < T.BillingTransactionIndex) AND (TransType = 1)) AS 'PreviousInvoiceBalance'FROM dbo.BillingTransactions2 AS T
Error belowSubquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
Not quite sure how to solve this