Jim,

Why not take care of this in one query?

Something to the affect of:

<cfquery name="myquery">
SELECT cast(datepart(mm, somedate), nvarchar(2)) + '/' +
cast(datepart(yyyy, somedate), nvarchar(4)) AS MonthAndYear
FROM sometable
ORDER BY somedate ASC
</cfquery>

<cfoutput query="myquery" group="MonthAndYear">
  #monthAndYear#
  <cfoutput>
    <!--- rows for this month and year --->
  </cfoutput>
</cfoutput>

-Joe


On Mon, 10 Jan 2005 15:02:36 -0700, Jim McAtee <[EMAIL PROTECTED]> wrote:
> What is a good way to loop over the months within a time period?  For
> example, given a starting date of 11/17/2003 and an end date of 2/19/2003,
> I'd need to loop through Nov03, Dec03, Jan04, Feb04.  Within the loop I'll
> be doing queries with a where clause like:
> 
> WHERE somedate BETWEEN #month#/1/#year#
>       AND #month#/#DaysInMonth("#month#/1/#year#")#/#year#
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:189875
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to