To: cf-talk
Subject: Re: Converting Year to Integer
The whole idea of not using to=#year(now())# and declaring it is
because the currYear variable is used at more than one place.
So if the variable is set used CFSET then there are couple of
modifications required.
NK
1) year(now
You'll need some hash signs around that currYear variable in your cfloop:
CFLOOP index=yearCnt from='2000' to='#currYear#'
tr
tdCFOUTPUT#yearCnt#/CFOUTPUT/td
/tr
/cfloop
Francois Levesque
http://blog.critical-web.com/
On Fri, Jul 24, 2009 at 9:31 AM, N K neetukais...@gmail.com wrote:
I am
## Sign does not help either.
NK
You'll need some hash signs around that currYear variable in your cfloop:
CFLOOP index=yearCnt from='2000' to='#currYear#'
tr
tdCFOUTPUT#yearCnt#/CFOUTPUT/td
/tr
/cfloop
Francois Levesque
http://blog.critical-web.com/
Is Year((now)) a typo in your email?
If not, try Year(Now()) and you will need the #'s in the to attribute of
cfloop.
Adrian
-Original Message-
From: N K [mailto:neetukais...@gmail.com]
Sent: 24 July 2009 14:31
To: cf-talk
Subject: Converting Year to Integer
I am looping the
Yes thats a typo in my email.Adding ## sign does not help
The error coming up is
Attribute validation error for the CFLOOP tag.
The value of the TO attribute is invalid. The value cannot be converted to a
numeric because it is not a simple value.Simple values are booleans, numbers,
cfset currYear= Year((now()))
cfset currYear=int(currYear)
CFLOOP index=yearCnt from='2000' to='#currYear#'
tr
tdCFOUTPUT#yearCnt#/CFOUTPUT/td
/tr
/cfloop
is working fine on my end. If you're still getting an error there must be a
typo somewhere.
Francois Levesque
Have you tried outputing your currYear variable, to make sure it is what you
expect?
On Fri, Jul 24, 2009 at 9:47 AM, N K neetukais...@gmail.com wrote:
Yes thats a typo in my email.Adding ## sign does not help
The error coming up is
Attribute validation error for the CFLOOP tag.
The
And failing that, post all your code...
-Original Message-
From: Dave Sueltenfuss [mailto:dsueltenf...@gmail.com]
Sent: 24 July 2009 14:56
To: cf-talk
Subject: Re: Converting Year to Integer
Have you tried outputing your currYear variable, to make sure it is
what you
expect
Yes thats a typo in my email.Adding ## sign does not help
you need to remove the quotes araound 2000
~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing
simple CFLOOP index=yearCnt from='2000' to='#year(now())#'
should work just fine.
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
On 24/07/2009 21:31, N K wrote:
CFLOOP index=yearCnt from='2000' to='currYear'
~|
Want
Solved , finally works , not sure what was wrong though.
NK
Have you tried outputing your currYear variable, to make sure it is what you
expect?
~|
Want to reach the ColdFusion community with something they want? Let them
currYear with out codes and inside ## sign WORKS !!!
CFLOOP index=yearCnt from='2000' to=#currYear#
NK
simple CFLOOP index=yearCnt from='2000' to='#year(now())#'
should work just fine.
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
On 24/07/2009 21:31, N K wrote:
CFLOOP
Right but something else is wrong.
Azadi's example is about as simple as it gets. Something else in your code
is causing the problem.
-Original Message-
From: N K [mailto:neetukais...@gmail.com]
Sent: 24 July 2009 15:09
To: cf-talk
Subject: Re: Converting Year to Integer
Try this:
CFLOOP index=yearCnt from='2000' to='#currYear#'
-Original Message-
From: Adrian Lynch [mailto:cont...@adrianlynch.co.uk]
Sent: Friday, July 24, 2009 9:44 AM
To: cf-talk
Subject: RE: Converting Year to Integer
Right but something else is wrong.
Azadi's example is about
This is the who;e code which I had to do in order for it work
cfset currYear= Year(now())
cfset currYear=int(currYear)
cfoutputcfset currYear=#currYear#/cfoutput
CFLOOP index=yearCnt from='2000' to=#currYear#
!---Query
/CFLOOP
And I do understand that every thing else listed on this
1) year(now()) returns an integer - there is no need to call int()
function on it.
2) the cfoutput... line in your code is totally useless and unnecessary.
3) is this code of yours in a cfm page or in a cfc function?
4) again, the simple
cfloop from=2000 to=#year(now())# index=yearCnt
ALWAYS
The whole idea of not using to=#year(now())# and declaring it is because
the currYear variable is used at more than one place.
So if the variable is set used CFSET then there are couple of modifications
required.
NK
1) year(now()) returns an integer - there is no need to call int()
17 matches
Mail list logo