I'm glad you posted this today, I just found this one a few minutes ago:
#Year(DateAdd("yyyy", 1, Now()))-1#
Thanks,
Eric Cobb
ECAR Technologies, LLC
http://www.ecartech.com
http://www.cfgears.com
Rick Root wrote:
> Three fun pieces of code I found today while doing some maintenance on
> code I did not write:
>
> #1 - here's what happens when you use varchar fields for numeric data!
>
> SELECT SUM(CAST(FLOOR(CAST(OI.ItemQuantity AS float)) AS int) *
> round(CAST(OI.ItemPrice AS float),2) * ((100-CAST(OI.ItemDiscount AS
> float))/100)) AS TotalOwed
>
> #2 - I'm not sure what the point of DEcimalFormat() is within a Val()
> statement.
>
> theAmountOwed =
> Val(DecimalFormat(GetOwed.TotalOwed))-(Val(DecimalFormat(GetMemberReunionTotal.ChargedTotal))+Val(DecimalFormat(GetPaid.AmountPaid)));
>
> #3 - DollarFormat(), anyone?
>
> theAmountOwed = "$" & Trim(NumberFormat(variables.theAmountOwed,"9999.99"));
>
> Oy!
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336691
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm