Hello Vbforums
I need to sum data from two tables.
This is the illustration
Table MTbl
ID...............Tarif
1 ................200
Table Act_tbl
ID....................Recette
1.......................300
I'm using sqlite3 and RC5
This is my attempt:
The output
200
200
500
Another attempt:
The output
200
I want the output to be 500
Any help is much appreciated
I need to sum data from two tables.
This is the illustration
Table MTbl
ID...............Tarif
1 ................200
Table Act_tbl
ID....................Recette
1.......................300
I'm using sqlite3 and RC5
This is my attempt:
Code:
StrSql = "select tarif, recette from MTbl " & _
" inner join Act_tbl on MTbl.Id = Act_tbl.ID"
Set Rs = Cnn.OpenRecordset(StrSql)
Do While Not Rs.EOF
Debug.Print val(Rs!Recette) + val(Rs!tarif)
Rs.MoveNext
Loop
200
200
500
Another attempt:
Code:
StrSql = "select tarif, recette from MTbl " & _
" inner join Act_tbl on MTbl.Id = Act_tbl.ID group by Act_tbl.ID"
Set Rs = Cnn.OpenRecordset(StrSql)
Do While Not Rs.EOF
Debug.Print val(Rs!Recette) + val(Rs!tarif)
Rs.MoveNext
Loop
200
I want the output to be 500
Any help is much appreciated