.... because,
dateformat(12/12/2006 1:36:51 PM, "MM/DD/YYYY")
is not a date/time object. Now,
CreateODBCDateTime(dateformat(12/12/2006 1:36:51 PM, "MM/DD/YYYY"))
should be a valid date/time object.
Or, you might be able to say:
dateformat("12/12/2006 1:36:51 PM", "MM/DD/YYYY")
and get your desired results, but then if CF recognizes "12/12/2006 1:36:51 PM"
as a valid date/time object (and I believe it does), then there'd be no point
in doing the dateformat. just do the date diff like this:
<CFSET number = DateDiff(d, "12/12/2006 1:36:51 PM", now())>
<cfoutput>#number#</cfoutput>
Give that a whirl. Also, when you're in a tag like <CFSet> you do not need to
put pounds around your variables unless you're dynamically evaluating them.
hope that helps,
Cheers,
Chris
[EMAIL PROTECTED] wrote:
> Why is this not working?
>
> <CFSET number = #DateDiff(d, dateformat(12/12/2006 1:36:51 PM, "MM/DD/YYYY"),
> dateformat(now(), "MM/DD/YYYY") )#>
> <cfoutput>#number#</cfoutput>
>
> ERROR
> The following information is meant for the website developer for debugging
> purposes.
>
> Error Occurred While Processing Request
> Missing argument name.
> When using named parameters to a function, every parameter must have a name.
> The CFML compiler was processing:
> an expression beginning with "#", on line 9, column 17.This message is
> usually caused by a problem in the expressions structure.
> a CFSET tag beginning on line 9, column 2.
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264388
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4