Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Jim and Tom Thanx for your quick reply. I tried your code and it works fine: For m = curMonth - 3\ -4 T curMonth - 1. The only problem is that a couple of columns in the spreadsheet ar skipped before the data is inserted. In other words when I say it mus only give me data for the last three months, it skips 7 columns befor displaying the data -- popp ----------------------------------------------------------------------- poppy's Profile: http://www.excelforum.com/member.php...fo&userid=1145 View this thread: http://www.excelforum.com/showthread.php?threadid=26604 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Possibly:
cn.Open cString j = 0 For m = curMonth - 3 To curMonth - 1 j = j + 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(j) '<=== change m to j -- Regards, Tom Ogilvy "poppy" wrote in message ... Hi Jim and Tom Thanx for your quick reply. I tried your code and it works fine: For m = curMonth - 3\ -4 To curMonth - 1. The only problem is that a couple of columns in the spreadsheet are skipped before the data is inserted. In other words when I say it must only give me data for the last three months, it skips 7 columns before displaying the data. -- poppy ------------------------------------------------------------------------ poppy's Profile: http://www.excelforum.com/member.php...o&userid=11453 View this thread: http://www.excelforum.com/showthread...hreadid=266048 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sum the data for specified months | Excel Discussion (Misc queries) | |||
Transpose data Months & Data to Rows | Excel Discussion (Misc queries) | |||
I want to put 1 years data and 1 months data togheter on one char. | Charts and Charting in Excel | |||
Last Months Data!! | Excel Worksheet Functions | |||
Get data for only last three months | Excel Programming |