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]
- ColdFusion workshop - any ideas? peter . tillbrook
- RE: ColdFusion workshop - any ideas? Angel Stewart
- Re: ColdFusion workshop - any ideas? Adam Churvis
- RE: ColdFusion workshop - any ideas? Mike Kear
- RE: ColdFusion workshop - any ideas? Jim Davis
- Re: ColdFusion workshop - any ideas? peter . tillbrook
- Calculate the date next Sunday Mike Kear
- RE: ColdFusion workshop - any ideas? Peter Tilbrook