P
poppy
Hi Experts
I am trying to extract data for the last three months. This is m
current code. This particular code pulls the data from January to th
end of September. I would like to pull only from July to the end o
September. How do I go about modifying my code to do this?
Code
-------------------
cn.Open cString
For m = 1 To curMonth - 1
MerchantMonthly = "select branch, sum(qty), sum(b.vat)" & _
" from service_providers a left outer join cb b on a.sp_name = b.sp_name and month" & _
" (inv_date) = " & m & " and year(inv_date) = " & curYear & " order by a.sp_name"
If rs.State = -1 Then rs.Close
rs.Open MerchantMonthly, cn, adOpenKeyset, adLockOptimistic, adCmdText
'dump data into excel by calling function
Call PopulatePage(m
-------------------
I'm getting the data from SQL server.
Kind Regard
I am trying to extract data for the last three months. This is m
current code. This particular code pulls the data from January to th
end of September. I would like to pull only from July to the end o
September. How do I go about modifying my code to do this?
Code
-------------------
cn.Open cString
For m = 1 To curMonth - 1
MerchantMonthly = "select branch, sum(qty), sum(b.vat)" & _
" from service_providers a left outer join cb b on a.sp_name = b.sp_name and month" & _
" (inv_date) = " & m & " and year(inv_date) = " & curYear & " order by a.sp_name"
If rs.State = -1 Then rs.Close
rs.Open MerchantMonthly, cn, adOpenKeyset, adLockOptimistic, adCmdText
'dump data into excel by calling function
Call PopulatePage(m
-------------------
I'm getting the data from SQL server.
Kind Regard