Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21243

how to calculate between 2 tables expenses and income in mschart & display profit

$
0
0
i have 2 tables that im trying to show a graph
i did some code(tried to)and get errors
i never used mschart i looked some examples in the web didnt help much
searched here also no result. i know there are proffesionals people here so i give it a try.
i attached my database also tables are CashBox & Expenses
code:
Code:

Dim r As New ADODB.Recordset
 
   
  r.Open "SELECT Format(ExpDate, ""yyyy-mmmm"") As ExpMonth SUM(ExpTotal) FROM Expenses Group By ExpItem, Format(ExpDate, ""yyyy-mmmm""), SUM(CashTotal) FROM CashBox Group By CashItem,Format(CashDate,""yyyy-mmmm"") ", CN, adOpenKeyset


    If r.EOF Then Exit Sub
    ReDim arrmn(1 To r.RecordCount, 1 To 3)
    For i = 1 To r.RecordCount
        arrmn(i, 1) = r.Fields(0)
        arrmn(i, 2) = r.Fields(1)
        arrmn(i, 3) = r.Fields(2)
       
        r.MoveNext
    Next
    MSChart.ChartData = arrmn
    r.Close
MSChart.Column = 1
MSChart.ColumnLabel = ""

HairDesign.zip
Attached Files

Viewing all articles
Browse latest Browse all 21243

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>