RE: Calculate the date next Sunday
What a wonderful thing this list is.Here we are, less than 30 minutes after I asked a questionI have an answer from the other side of the globe. This is just magic. Thanks Spike! Looks exactly what I want. Cheers, Michael Kear Windsor, NSW, Australia AFP Webworks. -Original Message- From: Spike [mailto:[EMAIL PROTECTED] Sent: Wednesday, 5 November 2003 4:53 PM To: CF-Talk Subject: Re: Calculate the date next Sunday Something like this should do: cfset dateOffset = 8-dayOfWeek(Now()) !--- If you want to set the effective date of the transaction as today if the day is sunday --- cfif dateOffset GT 1 cfset targetDate = dateAdd('d',dateOffset,Now()) cfelse cfset targetDate = Now() /cfif !--- If you want to make sure that transactions take at least 24 hours --- cfset targetDate = dateAdd('d',dateOffset,Now()) Spike Mike Kear wrote: I have a task where I have to insert the effective date of a transaction, which is the following Sunday, regardless of the day the form is submitted. Anyone know of a UDF or other functionality that'll work that out? Cheers, Michael Kear Windsor, NSW, Australia AFP Webworks. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: Calculate the date next Sunday
Not exactly the other side of the globe... I'm in Brisbane at the minute ;) Spike Mike Kear wrote: What a wonderful thing this list is.Here we are, less than 30 minutes after I asked a questionI have an answer from the other side of the globe. This is just magic. Thanks Spike! Looks exactly what I want. Cheers, Michael Kear Windsor, NSW, Australia AFP Webworks. -Original Message- From: Spike [mailto:[EMAIL PROTECTED] Sent: Wednesday, 5 November 2003 4:53 PM To: CF-Talk Subject: Re: Calculate the date next Sunday Something like this should do: cfset dateOffset = 8-dayOfWeek(Now()) !--- If you want to set the effective date of the transaction as today if the day is sunday --- cfif dateOffset GT 1 cfset targetDate = dateAdd('d',dateOffset,Now()) cfelse cfset targetDate = Now() /cfif !--- If you want to make sure that transactions take at least 24 hours --- cfset targetDate = dateAdd('d',dateOffset,Now()) Spike Mike Kear wrote: I have a task where I have to insert the effective date of a transaction, which is the following Sunday, regardless of the day the form is submitted. Anyone know of a UDF or other functionality that'll work that out? Cheers, Michael Kear Windsor, NSW, Australia AFP Webworks. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Calculate the date next Sunday
Brisbane!Oh,I saw the .co.uk address and assumed you're in the UK lamenting the lack of a rugby team. Instead you're in Brisbane, looking forward to the advent of the twentieth century some time soon. Thanks anyway Spike, your snippet of code is just the bees knees. Cheers, Michael Kear Windsor, NSW, Australia AFP Webworks. -Original Message- From: Spike [mailto:[EMAIL PROTECTED] Sent: Wednesday, 5 November 2003 5:45 PM To: CF-Talk Subject: Re: Calculate the date next Sunday Not exactly the other side of the globe... I'm in Brisbane at the minute ;) Spike [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Calculate the date next Sunday
I have a task where I have to insert the effective date of a transaction, which is the following Sunday, regardless of the day the form is submitted. Anyone know of a UDF or other functionality that'll work that out? Cheers, Michael Kear Windsor, NSW, Australia AFP Webworks. . [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: Calculate the date next Sunday
Something like this should do: cfset dateOffset = 8-dayOfWeek(Now()) !--- If you want to set the effective date of the transaction as today if the day is sunday --- cfif dateOffset GT 1 cfset targetDate = dateAdd('d',dateOffset,Now()) cfelse cfset targetDate = Now() /cfif !--- If you want to make sure that transactions take at least 24 hours --- cfset targetDate = dateAdd('d',dateOffset,Now()) Spike Mike Kear wrote: I have a task where I have to insert the effective date of a transaction, which is the following Sunday, regardless of the day the form is submitted. Anyone know of a UDF or other functionality that'll work that out? Cheers, Michael Kear Windsor, NSW, Australia AFP Webworks. . [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: Calculate the date next Sunday
Should probably amend that cfif block to something more like this: cfif dateOffSet EQ 7 cfset targetDate = Now() cfelse cfset targetDate = dateAdd('d',dateOffset,targetDate) /cfif Spike Spike wrote: Something like this should do: cfset dateOffset = 8-dayOfWeek(Now()) !--- If you want to set the effective date of the transaction as today if the day is sunday --- cfif dateOffset GT 1 cfset targetDate = dateAdd('d',dateOffset,Now()) cfelse cfset targetDate = Now() /cfif !--- If you want to make sure that transactions take at least 24 hours --- cfset targetDate = dateAdd('d',dateOffset,Now()) Spike Mike Kear wrote: I have a task where I have to insert the effective date of a transaction, which is the following Sunday, regardless of the day the form is submitted. Anyone know of a UDF or other functionality that'll work that out? Cheers, Michael Kear Windsor, NSW, Australia AFP Webworks. . [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]