I have a List of CustomerAccount called AccountsList, in CustomerAccount are a few fields which two of them are AccountInvoiceType and AccountInvoiceTypeVal.
To get the total value of all the Invoices I use the following.
AllInvoicesTotal = AccountsList.Sum(Function(item As CustomerAccounts) item.AccountInvoiceTypeVal)
What I want to do is get the value of all the invoices but use a where clause to only count the AccountInvoiceType = "Credit"
I thought it would be something like the following.
AllInvoicesTotal = AccountsList.Sum(Function(item As CustomerAccounts) item.AccountInvoiceTypeVal Where item.AccountInvoiceType = "Credit")
Any Ideas ?
Thanks
To get the total value of all the Invoices I use the following.
AllInvoicesTotal = AccountsList.Sum(Function(item As CustomerAccounts) item.AccountInvoiceTypeVal)
What I want to do is get the value of all the invoices but use a where clause to only count the AccountInvoiceType = "Credit"
I thought it would be something like the following.
AllInvoicesTotal = AccountsList.Sum(Function(item As CustomerAccounts) item.AccountInvoiceTypeVal Where item.AccountInvoiceType = "Credit")
Any Ideas ?
Thanks