Android Question how to add up the data in a database table

Stephanie lie

Member
Licensed User
upload_2017-1-6_14-41-0.png
 
Upvote 0

Stephanie lie

Member
Licensed User
else If Job.JobName = REVENUE_ESTIMATE Then
ACTUAL = parser.NextArray
For i = 0 To ACTUAL.Size - 1
m = ACTUAL.Get(i)
jmlh1 = m.Get("sum(jumlah1)")
lbActualSubtotal.Text = jmlh1

Next
m.Clear



Sub btnCari_Click
If btnCari.Text = "Cari" Then
If spnTglOrder.SelectedItem = "" Then
ToastMessageShow("Masukan Tanggal report yang akan dilihat",False)
Else
ExecuteRemoteQuery("SELECT SUM(jumlah1) FROM tbl_jobsheet_update WHERE date_update = '"&spnTglOrder.SelectedItem&"' ", REVENUE_ESTIMATE)
ExecuteRemoteQuery("SELECT SUM(jumlah2) FROM tbl_jobsheet_update WHERE date_update = '"&spnTglOrder.SelectedItem&"' ", REVENUE_ACTUAL)

' lbEstimiteSubtotal.Text = m.Get("jumlah1")
' lbActualSubtotal.Text = m.Get("jumlah2")
spnTglOrder.Enabled = False
btnCari.Text = "Clear"
End If

Else If btnCari.Text = "Clear" Then
btnCari.Text = "Cari"
lbEstimiteSubtotal.Text = ""
lbActualSubtotal.Text = ""
spnTglOrder.Enabled = True
lv1.Clear
End If
End Sub
 
Upvote 0

xpectmore

Member
Licensed User
Longtime User
this is no identifikasi Null what wrong ?
Mr.KMetle
1 make sure you add your xammp,mysql in firewall and works external.the right way to check that is enter your local
how to add data columns on the table using mysql database xampp
you can add data to any kind of php mysql server feature with erel's method:
https://www.b4x.com/android/forum/threads/connect-android-to-mysql-database-tutorial.8339/

i have tested on windows 10 with xampp PHP Version 7.0.9 MySQLi 5.0.12
with basic4android 5.80
i compiled apk with sdk 19
 
Upvote 0

Stephanie lie

Member
Licensed User
The code I want to show data by date to date

ExecuteRemoteQuery("SELECT SUM(jumlah1) FROM tbl_jobsheet_update WHERE year = '"&thn&"'", REVENUE_ACTUAL)
ExecuteRemoteQuery("SELECT SUM(uang_jalan) FROM tbl_jobsheet_update WHERE year = '"&thn&"'", COST_ACTUAL)
ExecuteRemoteQuery("SELECT SUM(profit) FROM tbl_jobsheet_update WHERE year = '"&thn&"'", PROFIT_ACTUAL)


Sub JobDone(Job As HttpJob)
ProgressDialogHide
If Job.Success Then
Dim res As String
res = Job.GetString
Log("Response from server: " & res)
parser.Initialize(res)
If Job.JobName = REPORT_LIST Then
REPORT_A2= parser.NextArray
For i = 0 To REPORT_A2.Size - 1
m = REPORT_A2.Get(i)
t1.First = m.Get("date_update")
t1.Second = m.Get("project")
lv1.AddTwoLines2(t1.First, t1.Second, t1)

JUMLAH

Next
CurrentIndex22 = 0
else If Job.JobName = REVENUE_ACTUAL Then
REVENUE = parser.NextArray
For i = 0 To REVENUE.Size - 1
m = REVENUE.Get(i)
jmlh = m.Get("SUM(jumlah1)")
lbRevenue.Text = jmlh
Next
m.Clear
else If Job.JobName = COST_ACTUAL Then
COST = parser.NextArray
For i = 0 To COST.Size - 1
m = COST.Get(i)
COST1 = m.Get("SUM(uang_jalan)")
lbCost1.Text = COST1
Next
m.Clear
else If Job.JobName = PROFIT_ACTUAL Then
PROFIT = parser.NextArray
For i = 0 To PROFIT.Size - 1
m = PROFIT.Get(i)
Keuntungan = m.Get("SUM(profit)")
lbProfit1.Text = Keuntungan
Next
m.Clear
End If
Else
ToastMessageShow("Tidak Ada Koneksi Jaringan", False)
End If
End Sub
 
Upvote 0
Top