1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
Connection
'********************************************************
' Caculer Seulement la somme des les valeurs du champ [total_ttc]_
' dont la valeur du champ [etat] est "Réglé"
'********************************************************
Adodc1.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=" + App.Path + "\unib_gestion.mdb;persist security info=false"
SQL = "SELECT sum([total_ttc]) as total,Year(date_facture)as ann, Month (date_facture)as moi" & _
" From facture where etat='Réglé'" & _
" GROUP By month([date_facture]), year([date_facture])"
Adodc1.RecordSource [COLOR="SeaGreen"]= SQL
Adodc1.Refresh
Set DRsynt.DataSource = Adodc1
'*******************************************************
' Caculer la somme de toutes les valeurs du champ [reste]
'*******************************************************
Adodc1.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=" + App.Path + "\unib_gestion.mdb;persist security info=false"
SQL = "SELECT sum([reste]) as rest,Year(date_facture)as ann, Month (date_facture)as moi" & _
" From facture" & _
" GROUP By month([date_facture]), year([date_facture])"
Adodc1.RecordSource = SQL
Adodc1.Refresh
Set DRsynt.DataSource = Adodc1
DRsynt.Show |
Partager