Sqlite with Sum support?

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
1 post Page 1 of 1
Contributors
User avatar
Dummy1912
VIP - Donator
VIP - Donator
Posts: 1969
Joined: Sat Aug 21, 2010 2:17 pm

Sqlite with Sum support?
Dummy1912
Hello,

Can someone helpme please
i need to know how we can use the SUM function with our column table

for example i need to calculate the Amount of all records but need to split them if row contains 1,2,3
accounts.type:
id,name
1 = Expense
2 = Income
3 = Refund

so how can we sum every amount of 1 ,2 ,3 in 1 single command?
and get the output to an Double

MyFunctions.iIncome = 0
MyFunctions.iExpense = 0
MyFunctions.iRefund = 0
Code: Select all
            Dim attributes As String = "Transactions.setdate,category.name,transactions.amount,transactions.description,transactions.id,groups.type,vendors.name,transactions.status,accounts.type"

            Dim whereClause As String = "transactions.category ='" & CurrentStatementsButton.Name & "' AND transactions.monthid ='" & CurrentStatementsButton.mMonthID & "' AND transactions.yearid ='" & CurrentStatementsButton.mYearID & "'"
            Dim fromClause As String = "LEFT JOIN category ON transactions.category=category.id LEFT JOIN groups ON transactions.type=groups.id LEFT JOIN vendors ON transactions.vendor=vendors.id LEFT JOIN accounts ON transactions.account=accounts.id"

            Dim empls As SQLiteDataReader = DataBase.executeQuery("SELECT " & attributes & " FROM transactions " & fromClause & " WHERE " & whereClause & " ORDER BY transactions.placecount ASC;")


Thanks
visit us on:


http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
1 post Page 1 of 1
Return to “Tutorial Requests”