RE: Converting Year to Integer
But then to take Azadi's point 4 and change it for this: 4) again, the simple cfset currentYear = year(now()) cfloop from=2000 to=#currentYear# index=yearCnt ALWAYS works. Something else is amiss. -Original Message- From: N K [mailto:neetukais...@gmail.com] Sent: 24 July 2009 18:48 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()) 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 works. Azadi Saryev Sabai-dee.com http://www.sabai-dee.com/ ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324966 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Converting Year to Integer
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 looping the records starting from the Year 2000 to current year. But some how the the CFLOOP gives me an error stating Can not convert into number I tried the following ,any idea how to fix the issue:-- cfset currYear= Year((now)) cfset currYear=int(currYear) table CFLOOP index=yearCnt from='2000' to='currYear' tr tdCFOUTPUT#yearCnt#/CFOUTPUT/td /tr /cfloop /table ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324923 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Converting Year to Integer
## 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/ ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324924 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Converting Year to Integer
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 records starting from the Year 2000 to current year. But some how the the CFLOOP gives me an error stating Can not convert into number I tried the following ,any idea how to fix the issue:-- cfset currYear= Year((now)) cfset currYear=int(currYear) table CFLOOP index=yearCnt from='2000' to='currYear' tr tdCFOUTPUT#yearCnt#/CFOUTPUT/td /tr /cfloop /table ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324925 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Converting Year to Integer
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, strings, and date-time values. Thank You NK 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 ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324927 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Converting Year to Integer
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 http://blog.critical-web.com/ 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 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, strings, and date-time values. Thank You NK 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 ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324928 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Converting Year to Integer
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 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, strings, and date-time values. Thank You NK 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 ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324929 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Converting Year to Integer
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? 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 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, strings, and date-time values. Thank You NK 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 ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324931 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Converting Year to Integer
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 lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324932 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Converting Year to Integer
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 to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324933 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Converting Year to Integer
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 know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324934 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Converting Year to Integer
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 index=yearCnt from='2000' to='currYear' ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324935 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Converting Year to Integer
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 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 index=yearCnt from='2000' to='currYear' ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324938 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
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 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 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 index=yearCnt from='2000' to='currYear' ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324939 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Converting Year to Integer
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 post should work but only the above worked and am using CF8. NK Try this: CFLOOP index=yearCnt from='2000' to='#currYear#' 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. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324940 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Converting Year to Integer
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 works. Azadi Saryev Sabai-dee.com http://www.sabai-dee.com/ On 24/07/2009 23:23, N K wrote: 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 post should work but only the above worked and am using CF8. NK Try this: CFLOOP index=yearCnt from='2000' to='#currYear#' 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. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324941 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
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()) 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 works. Azadi Saryev Sabai-dee.com http://www.sabai-dee.com/ On 24/07/2009 23:23, N K wrote: ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324947 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4