It does (MSSQLServer 2000) I think I've got it handled this way:

<!--- determines if today is within the current fiscal year 
  Author: Scott Stewart, Procomm 
  Date: 08/01/2008
  Comments: UDF taken from CFLIB.org
 --->
<cfscript>
 /**
 * Returns True if the date provided in the first argument lies between the two 
dates in the second and third arguments.
 * 
 * @param dateObj      CF 
 */
 function IsDateBetween(dateObj, dateCompared1, dateCompared2){
  return YesNoFormat((DateCompare(dateObj, dateCompared1) gt -1) AND 
(DateCompare(dateObj, dateCompared2) lt 1));
 }
</cfscript>
<cfset startYear = #datePart("yyyy", now())#>
<cfset endYear = #datePart("yyyy", now())# +1>

<cfset fyYearStart = '6/01/#datePart("yyyy", now())#'>
<cfset fyYearEnd = '7/01/#endYear#'>

<cfif (IsDateBetween(Now(),"#fyYearStart#","#fyYearEnd#") is "yes")>
 <cfset application.cat_date = #datePart("yyyy", now())# +1>
</cfif>
<!--- end --->

The application.cat_date becomes the year parameter that's passed to the query 
that retrieves the categories.

--
Scott Stewart 
ColdFusion Developer 
http://www.sstwebworks.com/blog

-------------- Original message from "Greg Morphis" <[EMAIL PROTECTED]>: 
-------------- 


> if your database supports BETWEEN, 
> you can 
> select foo 
> from my_tbl 
> where my_date between start_date and end_date 
> 
> or are you wanting to do that in ColdFusion? 
> 
> On Fri, Aug 1, 2008 at 12:46 PM, wrote: 
> > Hey all. 
> > > I've got a fiscal year that runs from July of a year to June of the next 
> > > (July 2008 to July 2009). In the body of the application that I'm runnng 
> > > I have a list 
> of categories that will change when the fiscal year changes. 
> > > I need to find out if now() falls in the current fiscal year and set a 
> > > date 
> variable that will be passed to a query to get the categories. 
> > > Does anyone have a code snippet that determines if a date falls in 
> > > between two 
> other dates? 
> > 
> > Thanks 
> > 
> > sas 
> > -- 
> > Scott Stewart 
> > ColdFusion Developer 
> > http://www.sstwebworks.com/blog 
> > 
> > 
> > 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:310066
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to