0
如果一個DataTable具有以下的列數據表中選擇行其中借方和貸方匹配
賬號(整數)(唯一)
借記(十進制)
信貸(十進制)
Selected(布爾型)
可能有幾行具有相同帳號和借項或貸記條目。我試圖做的是匹配借方和學分,他們加起來相同的價值,並通過遍歷所有行標記爲選中。任何想法來實現這個最好的方法?
謝謝
例如,
SQL
strSQL = "SELECT A_Sales_Ledger.Transaction_ID as 'Transaction', "
strSQL += "Customers.Cust_No as 'Acct', "
strSQL += "Customers.Cust_Name as 'Name', "
strSQL += "Customers.Add1 as 'Unit', "
strSQL += "A_Sales_Ledger.Debit as 'Debit', "
strSQL += "A_Sales_Ledger.Credit as 'Credit', "
strSQL += "A_Sales_Ledger.Document_Date as 'Date', "
strSQL += "A_Sales_Ledger.S_Description as 'Description' "
strSQL += "FROM A_Sales_Ledger "
strSQL += "JOIN Customers ON Customers.Customer_ID = A_Sales_Ledger.Customer_ID "
strSQL += "WHERE A_Sales_Ledger.Paid = 'N' "
strSQL += "ORDER BY Customers.Cust_No"
您是否嘗試過使用LINQ查詢加入表本身的帳號和地方信用等於借記 –
嘿康拉德 - 你能張貼的例子嗎?我沒有問題的帳戶號碼匹配的所有行,即SUM(信用)= SUM(借記)..謝謝 – gchq