First thing, remember to try and avoid using a function name as a variable
name.
<cfset theyear = DateFormat(DateAdd("yyyy",-1,Now()),"yyyy")>
Second, remember that don't need the pound sign on the right side (unless
you're inside quotes).
Also, this could be done simpler like so:
<cfset theyear = DateFormat(Now(),"yyyy")-1>
<!----------------//------
andy matthews
web developer
certified advanced coldfusion programmer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--------------//--------->
-----Original Message-----
From: Orlini, Robert [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 18, 2006 1:45 PM
To: CF-Talk
Subject: one year behind
How can I set this to be one year behind? Right now it displays 2006; I
would like it to display 2005
<cfset year = #dateformat(now(),"yyyy")#>
Thanks.
Robert O.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257264
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4