ส่วนโค้ด ใน vb6
*************************************************************
Private Sub ReceiveCompute()
Dim Str, sY, sM, Tm As String
Dim sqlrec As String
Dim sqlCust, mon As String
Dim i, k, M As Integer
Dim sumprice1 As Currency
i = 1
sqlrec = "select substring(BILL_DATE,'7') As bill_date,SUM(BILL_TOTALNET) As bill_sum"
sqlrec = sqlrec & " From bill"
sqlrec = sqlrec & " WHERE YEAR(BILL_DATE) = '" & CmbYear.text & "'"
sqlrec = sqlrec & " GROUP BY substring(BILL_DATE,'7') "
sqlrec = sqlrec & " ORDER BY 1"
With rsrec
If .State = adStateOpen Then .close
.ActiveConnection = SetDSNConnection
.CursorLocation = adUseClient
.CursorType = adOpenForwardOnly
.LockType = adLockOptimistic
.Open sqlrec
If rsrec.BOF = False Then
rsrec.MoveFirst
Do
Str = DateAdd( rsrec!bill_date) ' ส่วนตรงนี้ไม่รู้จะใส่ค่าอะไรให้แสดงในรูปแบบที่ต้องการค่ะ
With MSF_IN
.TextMatrix(i, 0) = i & "."
.TextMatrix(i, 1) = Format(Str, "mmmm/yyyy")
.TextMatrix(i, 2) = Format(rsrec!bill_sum, "#,##0.00")
.Rows = .Rows + 1
End With
i = i + 1
rsrec.MoveNext
Loop Until rsrec.EOF = True
End If
End With
With MSF_IN