Re: Check out this... code....

2010-08-31 Thread Bryan Stevenson

Just goes to showpeople will make things work no matter how
convoluted the code may become ;-)

Bryan Stevenson B.Comm.
VP  Director of E-Commerce Development
Electric Edge Systems Group Inc.
phone: 250.480.0642
fax: 250.480.1264
cell: 250.920.8830
e-mail: br...@electricedgesystems.com
web: www.electricedgesystems.com
 
Notice:
This message, including any attachments, is confidential and may contain
information that is privileged or exempt from disclosure. It is intended
only for the person to whom it is addressed unless expressly authorized
otherwise by the sender. If you are not an authorized recipient, please
notify the sender immediately and permanently destroy all copies of this
message and attachments.
Please consider the environment before printing this e-mail



~|
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:336685
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Check out this... code....

2010-08-31 Thread Eric Cobb

I'm glad you posted this today, I just found this one a few minutes ago:

#Year(DateAdd(, 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!

 SELECTSUM(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,.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


RE: Check out this... code....

2010-08-31 Thread Andy Matthews

You're right. The correct version should be:

#Year(DateAdd(, 0, Now()))# 

No need for the -1.



andy

-Original Message-
From: Eric Cobb [mailto:cft...@ecartech.com] 
Sent: Tuesday, August 31, 2010 4:13 PM
To: cf-talk
Subject: Re: Check out this... code


I'm glad you posted this today, I just found this one a few minutes ago:

#Year(DateAdd(, 1, Now()))-1#


Thanks,

Eric Cobb
ECAR Technologies, LLC
http://www.ecartech.com
http://www.cfgears.com



~|
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:336692
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Check out this... code....

2010-08-31 Thread Rick Eidson

Must be going through some of my old code...

:)

I find some shtuff in my own code all the time. 



Rick

-Original Message-
From: Andy Matthews [mailto:li...@commadelimited.com] 
Sent: Tuesday, August 31, 2010 4:25 PM
To: cf-talk
Subject: RE: Check out this... code


You're right. The correct version should be:

#Year(DateAdd(, 0, Now()))# 

No need for the -1.



andy

-Original Message-
From: Eric Cobb [mailto:cft...@ecartech.com] 
Sent: Tuesday, August 31, 2010 4:13 PM
To: cf-talk
Subject: Re: Check out this... code


I'm glad you posted this today, I just found this one a few minutes ago:

#Year(DateAdd(, 1, Now()))-1#


Thanks,

Eric Cobb
ECAR Technologies, LLC
http://www.ecartech.com
http://www.cfgears.com





~|
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:336694
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Check out this... code....

2010-08-31 Thread Eric Cobb

Exactly!  :)

Thanks,

Eric Cobb
ECAR Technologies, LLC
http://www.ecartech.com
http://www.cfgears.com



Andy Matthews wrote:
 You're right. The correct version should be:

 #Year(DateAdd(, 0, Now()))# 

 No need for the -1.



 andy

 -Original Message-
 From: Eric Cobb [mailto:cft...@ecartech.com] 
 Sent: Tuesday, August 31, 2010 4:13 PM
 To: cf-talk
 Subject: Re: Check out this... code


 I'm glad you posted this today, I just found this one a few minutes ago:

 #Year(DateAdd(, 1, Now()))-1#


 Thanks,

 Eric Cobb
 ECAR Technologies, LLC
 http://www.ecartech.com
 http://www.cfgears.com



 

~|
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:336696
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm