RE: One year behind

2007-01-08 Thread Brad Wood
year(now()) - 1 should work ~Brad -Original Message- From: Orlini, Robert [mailto:[EMAIL PROTECTED] Sent: Monday, January 08, 2007 11:30 AM To: CF-Talk Subject: One year behind How do I date format a year behind the current year? In other words, I would like to populate a dropdown

RE: One year behind

2007-01-08 Thread Adkins, Randy
Close But not quite: #Year(now())# (will give you 2007) #Year(dateAdd('y',-1,now()))# (will give you 2006) Or you can do the long way: #DateFormat(now(), '')# (will give you 2007) #DateFormat(dateAdd('y',-1,now()), '')# (will give you 2006) -Original Message- From: Orlini,

RE: One year behind

2007-01-08 Thread Ian Skinner
#dateAdd('y',-1,now(), )# That is not a valid function. You could do this. #dateFormat(dateAdd('',-1,now()),)# OR Year(now()) - 1 -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | |

RE: One year behind

2007-01-08 Thread Mark A Kruger
Robert, Try #Year(Dateadd('y',-1,now()))# -Original Message- From: Orlini, Robert [mailto:[EMAIL PROTECTED] Sent: Monday, January 08, 2007 11:30 AM To: CF-Talk Subject: One year behind How do I date format a year behind the current year? In other words, I would like to populate a

Re: One year behind

2007-01-08 Thread Terry Sta . Maria
Also, the dateAdd function uses '' to specify year (where 'y' specifies day of year). So #dateAdd('y',-1,now(), )# should be #dateAdd('',-1,now(), )#. Terry How do I date format a year behind the current year? In other words, I would like to populate a dropdown with 2006 and

Re: One year behind

2007-01-08 Thread Crow T. Robot
Try supplying the full date, not just the year portion. On 1/8/07, Orlini, Robert [EMAIL PROTECTED] wrote: How do I date format a year behind the current year? In other words, I would like to populate a dropdown with 2006 and 2007. Tried this, but no dice: #dateAdd('y',-1,now(), )#

Re: One year behind

2007-01-08 Thread Christopher Jordan
You've got too many arguments in dateAdd. Get rid of the , part. Cheers, Chris Orlini, Robert wrote: How do I date format a year behind the current year? In other words, I would like to populate a dropdown with 2006 and 2007. Tried this, but no dice: #dateAdd('y',-1,now(), )#

Re: One year behind

2007-01-08 Thread Christopher Jordan
Terry Sta. Maria wrote: Also, the dateAdd function uses '' to specify year (where 'y' specifies day of year). So #dateAdd('y',-1,now(), )# should be #dateAdd('',-1,now(), )#. Terry Terry: dateAdd only takes three arguments. Not four. |*DateAdd*|(/datepart/, /number/,

Re: One year behind

2007-01-08 Thread Crow T. Robot
Oops. Scratch my reply. I somehow missed the Now() portion of your example. On 1/8/07, Crow T. Robot [EMAIL PROTECTED] wrote: Try supplying the full date, not just the year portion. On 1/8/07, Orlini, Robert [EMAIL PROTECTED] wrote: How do I date format a year behind the current year?

Re: one year behind

2006-10-18 Thread Greg Morphis
try using dateadd() it asks for a part, like year, and then the offset, so you could do -1.. Should work for you On 10/18/06, Orlini, Robert [EMAIL PROTECTED] wrote: How can I set this to be one year behind? Right now it displays 2006; I would like it to display 2005 cfset year =

RE: one year behind

2006-10-18 Thread Mehdi, Agha
Option 1: cfset year = dateformat( now()-365, ) / Option 2: cfset year = Year( now() ) - 1 / Agha Mehdi IDT - eBusiness Program Manager -Original Message- From: Orlini, Robert [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 18, 2006 11:45 AM To: CF-Talk Subject: one year

RE: one year behind

2006-10-18 Thread Sandra Clark
, 2006 2:53 PM To: CF-Talk Subject: RE: one year behind Option 1: cfset year = dateformat( now()-365, ) / Option 2: cfset year = Year( now() ) - 1 / Agha Mehdi IDT - eBusiness Program Manager -Original Message- From: Orlini, Robert [mailto:[EMAIL PROTECTED] Sent: Wednesday, October

Re: one year behind

2006-10-18 Thread Aaron Rouse
Spaces are not allowed in variable names. :) On 10/18/06, Sandra Clark [EMAIL PROTECTED] wrote: Doesn't account for leap years. cfset last year = dateadd('y', -1, now()) Sandra Clark == http://www.shayna.com Training in Cascading Style Sheets and

RE: one year behind

2006-10-18 Thread Orlini, Robert
Thanks Agha and Greg -Original Message- From: Mehdi, Agha [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 18, 2006 2:53 PM To: CF-Talk Subject:RE: one year behind Option 1: cfset year = dateformat( now()-365, ) / Option 2: cfset year = Year( now() ) - 1 / Agha

RE: one year behind

2006-10-18 Thread Ian Skinner
Doesn't account for leap years. cfset last year = dateadd('y', -1, now()) Sandra Clark Close Sandra. 'Y' if for Day of Year, '' is for year. So it should be: cfset last year = dateAdd('', -1, now()) -- Ian Skinner Web Programmer BloodSource www.BloodSource.org

RE: one year behind

2006-10-18 Thread Andy Matthews
First thing, remember to try and avoid using a function name as a variable name. cfset theyear = DateFormat(DateAdd(,-1,Now()),) 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 =

RE: one year behind

2006-10-18 Thread Sandra Clark
To: CF-Talk Subject: RE: one year behind Doesn't account for leap years. cfset last year = dateadd('y', -1, now()) Sandra Clark Close Sandra. 'Y' if for Day of Year, '' is for year. So it should be: cfset last year = dateAdd('', -1, now()) -- Ian Skinner Web Programmer

RE: one year behind

2006-10-18 Thread Brad Wood
And it could be done even simpler with the year() function. ~Brad -Original Message- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 18, 2006 2:25 PM To: CF-Talk Subject: RE: one year behind First thing, remember to try and avoid using a function name