First of all, thank god i'm not the last person in the world to stop 
using uppercase code =)

Second... if coldfusion says DIFFTYPE doesn't exist, then it probably 
means that none of your <cfcase> statements matched, and thus difftype 
was never set.

Probably because you have an error in your cfswitch expression.  That 
expression always evaluates as the string "lead_time_type_id"

It should be:

<cfswitch expression="#lead_time_type_id#">

One other note... you don't need # symbols when referring to variables 
as function arguments, ie:

        <cfset diff = DateDiff(difftype, now(), deadline)>

versus

        <cfset diff = DateDiff(#difftype#, now(), #deadline#)>

  - Rick

Chris Kavanagh wrote:
> Hi List,
> 
> This CFSET is returning the error: "Variable DIFFTYPE is undefined."
> 
> --
> 
> <CFOUTPUT query="get_tasks">
>      <CFSWITCH EXPRESSION="lead_time_type_id">
>               <CFCASE VALUE="1"><CFSET difftype="""n"""></CFCASE>
>               <CFCASE VALUE="2"><CFSET difftype="""h"""></CFCASE>
>               <CFCASE VALUE="3"><CFSET difftype="""d"""></CFCASE>
>               <CFCASE VALUE="4"><CFSET difftype="""ww"""></CFCASE>
>       </CFSWITCH>
>    <CFSET diff = DateDiff(#difftype#, Now(), #deadline#)>
> </CFOUTPUT>
> 
> --
> 
> :/   Can anybody see what I'm doing wrong?
> 
> Thanks guys,
> CK.
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192595
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to