<CFIF DateDiff("yyyy", Now(), datevariablepassed) LT 1>
 the date variable is within one year of now.
<CFELSE>
 the date variable is older than one year
</CFIF>

By te way,
A less efficient way of doing this, which is more flexible in that you don't
have to be testing for a date within an interval of now (i.e. you could
specify a range) might look something like this:

<CFSET tempdate = DateAdd("yyyy", 1, Now())>

<CFIF DateDiff("d", Now(), tempdate) GT DateDiff("d", Now(),
yourdatevariable)>
        The date variable occured within the last 12 months
<CFELSE>
        this date is Greater han one year old
</CFIF>

~Simon

> Simon Horwith
> Certified ColdFusion Developer
> Fig Leaf Software
> 1400 16th St NW, # 220
> Washington DC 20036
> 202.797.6570 (direct line)
> www.figleaf.com
> 


-----Original Message-----
From: freeee meeeee [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 30, 2000 10:59 AM
To: CF-Talk
Subject: Get the last 12 months transactions?


Does anyone know how to test that a date is in the last 12 months?
____________________________________________________________________________
_________
Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to