Skip to main content
Participating Frequently
June 29, 2006
Answered

Nesting CFIF inside CFSET

I am trying to create a calculation using an CFIF tag inside of a CFSET tag. I keep getting an error message stating

< marks the beginning of a ColdFusion tag.Did you mean LT or LTE?

Here is my code:

<CFSET SqFtCost = (#price# <CFIF #LocationType# EQ "Install"> + #padcost# </CFIF> )/#gpamount# )>

Any help is appreciated

Msfitz
This topic is closed to new replies. Start a new post to keep the conversation going.
pete_freitag
pete_freitagCorrect answer
Participating Frequently
June 29, 2006
Try things th other way around, like this:

7 replies

Inspiring
June 29, 2006
You can't put one CF tag within another. So revise your logic/statement
ordering so you're not inclined to want to.

Hint:
One <cfif>. One <cfelse>. Two <cfsets> (not in that order ;-).

--
Adam
Translate
June 30, 2006
> You can't put one CF tag within another.

Except, of course, within a CFQUERY.
Translate
pete_freitag
pete_freitagCorrect answer
Participating Frequently
June 29, 2006
Try things th other way around, like this:
Translate
mfitzAuthor
Participating Frequently
June 29, 2006
That did the trick. Thanks!
Translate