On Sunday, September 8, 2002, at 02:24 , Ruslan Sivak wrote:
Hi, I'm having a problem with iif.
Don't use it. If you used cfif, you wouldn't be having these problems. You'
ve got a boolean test and you set a string value which you then test later
(why not just use the same test or at least use
[EMAIL PROTECTED]
Sent: Sunday, September 08, 2002 7:45 PM
Subject: RE: iif usage
That's the whole point, Joe... I have the following code above it
cfif not qryCustomer.allareas
cfquery name=qryAreas datasource=#request.dsn#
somequery
/cfquery
/cfif
So therefore, qryAreas.name will only
Iif is necessary in certain cases. Last time I checked, you can't use
cfif inside other cf tags... (Maybe in mx you can).
Russ
-Original Message-
From: Sean A Corfield [mailto:[EMAIL PROTECTED]]
Sent: Sunday, September 08, 2002 8:48 PM
To: CF-Talk
Subject: Re: iif usage
On Sunday
Iif is necessary in certain cases.
I can't think of a single case in which it's necessary. It's just another
way to perform conditional logic. If you have one way to perform conditional
logic, you can do anything you need, although it might be clumsier in some
situations than an alternative
IIF is never necessary.
-Original Message-
From: Ruslan Sivak [mailto:[EMAIL PROTECTED]]
Sent: Sunday, September 08, 2002 9:45 PM
To: CF-Talk
Subject: RE: iif usage
Iif is necessary in certain cases. Last time I checked, you can't use
cfif inside other cf tags... (Maybe
On Sunday, September 8, 2002, at 08:45 , Ruslan Sivak wrote:
Iif is necessary in certain cases.
No it isn't.
Last time I checked, you can't use
cfif inside other cf tags... (Maybe in mx you can).
You can always restructure such code to not need 'iif()'.
Sean A Corfield -- http
I dont agree with Sean or Dave... i dont think IIF is necessary but its
a very useful function ... IF USED PROPERLY
For me
#IIF(expression... , , )# is much more concise code
than writting...
cfif
else
/cfif
Many of you guys dont agree.. but i personally prefer using IIF and i
use
On Tuesday, September 3, 2002, at 07:01 , Joe Eugene wrote:
Ben Forta actually explains this in detail in one of his CF5.0 books and
it
actually looked powerful..
Oh dear... It's unfortunate that Ben documented something that wasn't even
supposed to be legal...
cfset Result=iif(x,z='Arg1
In CF5.0, You used to be able to do
cfset x=1
cfset Result=iif(x,z='Arg1';5,z='Arg2';10)
Result takes the value of the right most argument of ;
in this case Result=5
This doesnt work in CFMX.. any ideas?
I didnt see any documented changes on IIF in CFMX docs.
Joe
Joe Eugene [EMAIL PROTECTED] wrote:
You used to be able to do in CF5.0
cfset x=1
cfset Result=iif(x,z='Arg1';5,z='Arg2';10)
Interesting. That's actually a primitive form of CFSCRIPT -- the CF 4.x and CF 5
expression parser was actually the CFSCRIPT parser in a locked-down mode. Mostly
On Tuesday, September 3, 2002, at 09:43 , Tom Harwood wrote:
Joe Eugene [EMAIL PROTECTED] wrote:
You used to be able to do in CF5.0
cfset x=1
cfset Result=iif(x,z='Arg1';5,z='Arg2';10)
Interesting. That's actually a primitive form of CFSCRIPT -- the CF 4.x
and CF 5 expression parser
in java.
cfset x=1
cfset Result=iif(x,z='Arg1';5,z='Arg2';10)
Anyways i guess re-write
Does CFMX advice any other way..than writing CFIF's or CFSCRIPT IF's?
Thanks
Joe
-Original Message-
From: Sean A Corfield [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 03, 2002 1:03 PM
You used to be able to do in CF5.0
cfset x=1
cfset Result=iif(x,z='Arg1';5,z='Arg2';10)
Result takes the value of the right most argument of ;
in this case Result=5
This doesnt work in CFMX.. any ideas?
I didnt see any documented changes on IIF in CFMX docs.
Joe
Please help me with this or can you guys and gals tell me a better way to
code this. Of course the phrases will be changed but this will give you the
basic concept.
Josh
#iif((qryquicklinks.recordcount gte 8), DE(onClick='alert(Sorry, you
suck)';), DE(onClick='alert(You Deleted Me
the phrases will be changed but this will give you the
JT basic concept.
JT Josh
JT #iif((qryquicklinks.recordcount gte 8), DE(onClick='alert(Sorry, you
JT suck)';), DE(onClick='alert(You Deleted Me)';))#
JT
__
Get the mailserver
I fill like a nimrod I am going home I am tired.
Josh
-Original Message-
From: Patric Stumpe [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:42 AM
To: CF-Talk
Subject: Re: iif driving me nuts
Hi Joshua,
you could also use a simple (perhaps faster cfif-statement like
actually, the quickbooks timer program spits out timer files in
IIF. then QB can read them in. we've done some preliminary
testing, and it looks quite possible.
This is indeed correct. I've got the quickbooks -- my application about
90% completed, without any problem except
IIF File
actually, the quickbooks timer program spits out timer files in
IIF. then QB can read them in. we've done some preliminary
testing, and it looks quite possible.
This is indeed correct. I've got the quickbooks -- my application about
90% completed, without any problem except
Hi Group,
I need to create an IIF file of invoices that can be imported into
Quickbooks. Does anyone have a sample, customtag or otherwise to speed the
process?
Any help would be greatly appreciated.
Sincerely yours,
Jim Gurfein
President, CEO
RestaurantRow.com, Inc.
http
, 2002 2:25 PM
To: CF-Talk
Subject: Quickbooks IIF File
Hi Group,
I need to create an IIF file of invoices that can be imported into
Quickbooks. Does anyone have a sample, customtag or otherwise to speed the
process?
Any help would be greatly appreciated.
Sincerely yours,
Jim Gurfein
A quick Google yielded this:
http://developer.intuit.com/quickbooks/faq.asp
Perhaps the QB SDK has more info?
Pete
- Original Message -
From: Christopher Olive [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Thursday, April 18, 2002 3:26 PM
Subject: RE: Quickbooks IIF File
Hehe... Me Three! Working on an export/import for timer/quickbooks :)
Dave Schmidt
-Original Message-
From: Christopher Olive [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 18, 2002 12:27 PM
To: CF-Talk
Subject: RE: Quickbooks IIF File
i'll have to me too that one. i'm
To: CF-Talk
Subject: RE: Quickbooks IIF File
Hehe... Me Three! Working on an export/import for timer/quickbooks :)
Dave Schmidt
-Original Message-
From: Christopher Olive [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 18, 2002 12:27 PM
To: CF-Talk
Subject: RE: Quickbooks IIF
actually, the quickbooks timer program spits out timer files in IIF. then QB can read
them in. we've done some preliminary testing, and it looks quite possible.
christopher olive
cto, vp of web development, vp it security
atnet solutions, inc.
410.931.4092
http://www.atnetsolutions.com
Can someone help me with this.. I am knew at using IIF, but from my
understanding it whould work here:
cfinput type=Text name=ShowDate
value=iif(url.showdate,DateFormat(url.showdate,mm-dd-),DateFormat(now(
),mm-dd-))#
Thanks,
Mike
Michael T. Tangorre
Try adding the Delayed Evaluation function, DE()
iif(url.showdate,DE(DateFormat(url.showdate,mm-dd-)),DE(DateFormat(now
(),mm-dd-)))
Can someone help me with this.. I am knew at using IIF, but from my
understanding it whould work here:
cfinput type=Text name=ShowDate
value=iif
why is it when you use IIF() and you are checking to see if a variable
exists, the process will error out? here is an example:
#IIF(IsDefined(FORM.classCodeID), DE(FORM.classCodeID), DE(ALL))#
if FORM.classCodeID exists, the code works fine. but if FORM.classCodeID
doesn't exist, it errors
AFAIK the IIF tag evaluates both the true and the false sections as the
function is processed... The best thing to do would be cfparam the
variable and check to see if it contains data.
CFPARAM NAME=FORM.classCodeID DEFAULT=
#IIF(Len(FORM.classCodeID), DE(#FORM.classCodeID#), DE(ALL
I ran into this just yesterday.
The issue seems to be that since this is a CF function and not a tag it
processes it inside out. Not the same as a CFIF where it will skip
elements of the if statement should it be false.
The IIF prepares the two DE arguments before it evaluates it's
conditional
Ok, it's not a problem as such, just the way functions work... before IIF
can be run (before any function can be run) all the arguments must be
resolved, the second argument in your example may not be resolved because
FORM.classCodeID may not exist. The correct way to write this...
#IIF
Can someone Please help me with this one.
#iif((dateformat(i, mm-dd-yy) eq (dateformat(qrygetusers1.we_date,
mm-dd-yy)), de(checked), de())#
#iif((dateformat(i, mm-dd-yy) eq (dateformat(qrygetusers1.we_date,
mm-dd-yy)), de(checked), de())#
With the quotes around the dateformat, you're
I'd do a dateCompare() or a dateDiff() rather than messing with the
dateFormat(). Something like: #iif( NOT dateCompare(i,
qrygetusers1.we_date), DE('checked'), DE('')#
HTH,
Bill
-Original Message-
From: Joshua Tipton [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 17, 2001 6:22 AM
At 02:22 AM 10/18/2001, you wrote:
Can someone Please help me with this one.
#iif((dateformat(i, mm-dd-yy) eq (dateformat(qrygetusers1.we_date,
mm-dd-yy)), de(checked), de())#
what was with the extra quotes and brackets ? this looks better...
#iif(dateformat(i, mm-dd-yy) eq dateformat
Can someone Please help me with this one.
#iif((dateformat(i, mm-dd-yy) eq (dateformat(qrygetusers1.we_date,
mm-dd-yy)), de(checked), de())#
~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http
This problem is kinda hard to explain, but does anyone have
any idea on how
to fix this??? (without having to use CFIF/CFELSE - the whole
point is that
I want to use IIF and DE)
This isn't what you want to hear, but, FWIW I've had exactly the same thing
and ended up using CFIF. Annoying
What you have to do is this:
(assuming you're using variables temp1 and temp2)
IIF(condition, DE(#evaluate('temp1')#), DE(#evaluate('temp2')#))
By using evaluate, it doesn't try to pass the undefined variable in as a
parameter to the function, but when it hits the DE(), it does an evaluate
Not exactly. IIF() creates an IF/ELSE scenario which, technically speaking,
could be considered two statements even though only one of them actually has
a condition defined.
Fact of the matter is, this comes down to what's called short circuit
logic. In most languages in any if/else pair, once
have the
option of compiling ColdFusion (as far as I know, anyway) to rid yourself of
errors like this, you hit the problem at run-time. IIF does in fact short
circuit like it's supposed to.
-Original Message-
From: Tyson Vanek [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 30, 2001 10
thread):
cfset orderString =
iif(isDefined(attributes.order),DE(amp;order=#attributes.order#), )
cflocation url=index.cfm?fuseaction=tools#orderString#
If I'm understanding your workaround example correctly, here's what you're
proposing instead:
cfset orderString =
iif(isDefined(attributes.order),DE
why not just
cfparam name=attributes.order default=
at the top of the page, then do:
cfset orderString = iif(attributes.order gt ,de(#attributes.order#),
)
Marlon
- Original Message -
From: Brent Goldman [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Wednesday, August 29
Oops. Sorry...
It's this:
cfset temp1 = stuff
cfoutput
#evaluate(IIF(isDefined (temp1), DE(temp1), DE(temp2)))#
/cfoutput
The evaluate goes around the IIF instead of around the variable names (I
didn't think it through well enough before I sent out the message).
Now that's assuming
Hi,
Yes, that WILL work, but the second statement in the IIF statement is not
just a variable, but a string that uses the variable WITHIN. That's the
problem.
-Brent
-Original Message-
From: Dave Feltenberger [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 30, 2001 8:26 AM
To: CF
I'd suggest writing your code in a different way - what you're trying to do
(i.e. the way you're doing it) isn't possible.
-Original Message-
From: Brent Goldman [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 30, 2001 6:41 PM
To: CF-Talk
Subject: RE: IIF and DE
Hi,
Yes
Hi,
Actually, it is possible. I just got it to work earlier today. The code is
below:
cfset orderString = iif(isDefined(attributes.order), 'amp;order='
attributes.order, DE())
Try it - it works.
-Brent
-Original Message-
From: Dave Feltenberger [mailto:[EMAIL PROTECTED]]
Sent
Hi,
I'm trying to use IIF with DE, and it doesn't seem to be working. My code:
cfset orderString = iif(isDefined(attributes.order),
DE(amp;order=#attributes.order#), )
cflocation url=index.cfm?fuseaction=tools#orderString#
What I am trying to do is this: if a certain variable is defined
of ColdFusion 4.5 - I might be wrong on the version number.
My guess is that this behavior is still leftover in the iif() function.
I've noticed this in my own development as well that I never seem to be able
to use an isDefined() check in an iif() block. Doing so always results in
the Error
Message-
From: Tyson Vanek [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 29, 2001 5:57 PM
To: CF-Talk
Subject: RE: IIF and DE
This goes back to the way the old CFIF used to behave. In the past (I
think up until CF ver 4.5), the same problem existed with CFIF. Here's an
example. Say
Is there any way to use Iif with (for example) a date time variable
retrieved from a database so that if it's defined, it extracts the Day
portion of the date, but if the date is null, uses Day(Now()) instead?
If(NOT Len(AccountExpires), DE(Day(Now())), DE(Day(AccountExpires)))
When
My piece sent prior to this would probably work better if made as part
of
Your query statement to the database.
Conrad
-Original Message-
From: Aidan Whitehall [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 13, 2001 12:55 PM
To: CF-Talk
Subject: Iif, short circuit evaluation and DE
Rather use: IIf(IsNull([AccountExpires], Day(Now()),
Day([AccountExpires]))
In most cases, it is a safe bet to use the expression like this for most
fields.
The one that will not work is the Yes/No Type, where you have to
evaluate it to Being either 0 (not selected) or otherwise (-1).
Conrad
Ok, after a bit of testing... can anyone tell me what the
advantage of IIF over if (cfif or if () {}), else (cfelse
or else {}).
I tested a simple block of code using IIF and
cfifcfelse/cfif IIF ran twice as slow...
I can't see any major advantage by using it... yeah, it is
kinda
My understand, based on what an expert (seminar instructor) said was that
yes, IIF is significantly slower than using CFIF and should be avoided if
possible. But there are cases where IIF can be used where CFIF can't. For
example, one way of alternating the highlight background color on table
-
From: Bruce Holm [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 26, 2001 3:40 PM
To: CF-Talk
Subject: Re: IIF vs if,else
My understand, based on what an expert (seminar instructor) said was that
yes, IIF is significantly slower than using CFIF and should be avoided if
possible. But there are cases
Sure it can...
tr bgcolor=cfif getitem.currentrow mod 2bluecfelsewhite/cfif
At 3:40 PM -0700 6/26/01, Bruce Holm wrote:
My understand, based on what an expert (seminar instructor) said was that
yes, IIF is significantly slower than using CFIF and should be avoided if
possible
and much cleaner :)
-Original Message-
From: Dick Applebaum [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 26, 2001 4:07 PM
To: CF-Talk
Subject: Re: IIF vs if,else
Sure it can...
tr bgcolor=cfif getitem.currentrow mod 2bluecfelsewhite/cfif
At 3:40 PM -0700 6/26/01, Bruce Holm
it's not. I've never found a reason to use IIF over CFIF. It's only saving
grace is that when you are using an IF statement to set attributes inside a
TD tag (like CLASS=), IIF won't cause Studio to screw up the color scheme
of your code
On 6/20/01, Cameron penned:
if () {}), else (cfelse or else {}).
I tested a simple block of code using IIF and cfifcfelse/cfif
IIF ran twice as slow...
I can't see any major advantage by using it... yeah, it is kinda
similar to i = (true?1 : 2); in javascript but it's really slow case
IIF is much slower than a standard CFIF. 'nuff said.
Ok, after a bit of testing... can anyone tell me what the advantage of IIF
over if (cfif or if () {}), else (cfelse or else {}).
I tested a simple block of code using IIF and cfifcfelse/cfif IIF
ran twice as slow...
I can't see any major
Cameron, it's well known that IIF is much slower. As far as I know, the
only real advantage to using it is that it's useful in some cases because
you can write less code, which can be easier to read. And it is useful if
you actually need to return some evaluated expression.
Avi
At 11:02 AM 6
The only advantage would be if you, as a coder, prefer the IIF() format over
the CFIFCFELSE... format. Where performance is an issue, stay away from
the use of ColdFusion's dynamic functions such as IIF() as performance will
definitely suffer.
Gary Groomer
- Original Message -
From
Note - this was written in 1280 x 1024 maximized. This will probably not
look too great on smaller resolutions. I suggest copying this to notepad
and turning wordwrap off to view properly...
Iif can reduce the amount of code you need to write.
For example:
cfset myValue = 1
input name
Ok, after a bit of testing... can anyone tell me what the advantage of IIF over if
(cfif or if () {}), else (cfelse or else {}).
I tested a simple block of code using IIF and cfifcfelse/cfif IIF ran twice as
slow...
I can't see any major advantage by using it... yeah, it is kinda similar
I can attest to that statement. We had a custom tag that
used those three
functions HEAVILY - iif, de, and evaluate. It was very very
very very slow.
Does anyone know if the speed of these functions will be improved in CF5, it
having been said that CF5 runs faster on the same hardware
I can attest to that statement. We had a custom tag that
used those three functions HEAVILY - iif, de, and evaluate.
It was very very very very slow.
Does anyone know if the speed of these functions will be
improved in CF5, it having been said that CF5 runs faster on
the same
To: CF-Talk
Subject: RE: question using IIf
I recently picked up a copy of Ben Forta's Certified CF Study Guide. One
of the last chapters is about speed and optimization, and it states that
IIF(), DE() and Evaluate() are all very slow functions, and while they have
their time and place, can
I've been told that we should never use IIF and i just took that on blind
faith. I've seen everyone using it for their changing table row background
colors though so now i'm wondering if i've been told something in error. can
anyone shed any light on this? thanks in advance.
david
tr bgcolor
* Team Allaire *
IIF is way slower than the equivalent CFIF. This does the same thing and is
faster.
tr bgcolor=CFIF qName.CurrentRow MOD 2ffCFELSEe8e8e8/CFIF
I've been told that we should never use IIF and i just took that on blind
I think #IIF()# just takes longer to evaluate than Cfif or the even faster
cfswitch...
At leasts that what I have gathered from others experience and from classes.
HTH
Dan
-Original Message-
From: David Baskin [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 01, 2001 12:55 PM
To: CF-Talk
I recently picked up a copy of Ben Forta's Certified CF Study Guide. One
of the last chapters is about speed and optimization, and it states that
IIF(), DE() and Evaluate() are all very slow functions, and while they have
their time and place, can and perhaps should often be avoided (Ben
Latest CFDJ states that iif takes 4 times as long to execute as
cfifcfelse/cfif. The provide a snippet of code to test.
- Original Message -
From: David Baskin [EMAIL PROTECTED]
I've been told that we should never use IIF and i just took that on blind
faith. I've seen everyone using
I can attest to that statement. We had a custom tag that used those three
functions HEAVILY - iif, de, and evaluate. It was very very very very slow.
Unfortunately for us, it is the core of our application - so it was
rewritten as a CFX, then a COM component, and not it is a hybrid COM/XML
I personally don't think there is anything wrong using iif...
bgcolor = #IIf(CurrentRow Mod 2, DE('ff'), DE('dd'))#
class= #IIf(CurrentRow Mod 2, DE('altcolor1'), DE('altcolor2'))#
I use both of these... the Class allows me to set the color in the Style
sheet.
Nathan Stanford
No one said there wa anything 'wrong' with IIF, just that it is slower than
other ways of doing things (read: I still use it occaisonally)...which is
pretty undeniable when you run a benchmark comparing them. I would supply
values, but I did the benchmarking nearly 2 years ago. No time to do
. It was not intended too.
Nathan Stanford
Senior Programmer/Analyst
[EMAIL PROTECTED]
-Original Message-
From: Bryan Batchelder [SMTP:[EMAIL PROTECTED]]
Sent: Tuesday, May 01, 2001 2:31 PM
To: CF-Talk
Subject: RE: question using IIf
No one said there wa anything 'wrong' with IIF, just
At 1/25/2001 06:13 PM +, Stephen Moretti wrote:
snip
Cfoutput#iif(isDefined("Attributes.display"),Trim(attributes.name"_query.
"attributes.display),DE(''))#/cfoutput
This is good advice, and it will also not throw any errors if attributes.display is
not defined
I'm using iif, and running into some weird things. Well first of all I'm
generating CF on the fly, so I need to escape # so that the variables don't
get evaluated until they are in the generated file. For example I'm using
something like this. Is this the right way to do
Ruslan,
I'm using iif, and running into some weird things. Well first of all I'm
generating CF on the fly, so I need to escape # so that the
variables don't
get evaluated until they are in the generated file. For example I'm using
something like this. Is this the right way to do
I think you have 2 too many #'s in there. You can also try
#iif(isDefined("Attributes.display"),DE(RTrim("#Chr(35)##attributes.name#_qu
ery.#
attributes.display##Chr(35)#")),DE(""))#
Chr(35) = #
Blessed Be,
--Katrina Chapman
http://www.katrinachapman.com
http://w
Can anyone tell me why this isn't working. I can't stare at this any
longer. The output runs fine until there is a CYOriginal = 0. Blows up.
Help, Please.
CFOUTPUT#IIF(CYOriginal EQ 0, IIF(Requested GT 0, DE("100.0"), DE("0.0")),
NumberFormt(100*Change/CYOriginal, '__._
19, 2001 0:39
To: CF-Talk
Subject: IIF Problem
Can anyone tell me why this isn't working. I can't stare at this any
longer. The output runs fine until there is a CYOriginal = 0. Blows up.
Help, Please.
CFOUTPUT#IIF(CYOriginal EQ 0, IIF(Requested GT 0, DE("100.0"), DE("0.0"
Hi Jennifer,
Can anyone tell me why this isn't working. I can't stare at this any
longer. The output runs fine until there is a CYOriginal = 0. Blows up.
Help, Please.
CFOUTPUT#IIF(CYOriginal EQ 0, IIF(Requested GT 0, DE("100.0"),
DE("0.0")),
NumberFormt(1
Can anyone tell me why this isn't working. I can't stare at this any
longer. The output runs fine until there is a CYOriginal = 0. Blows up.
Help, Please.
CFOUTPUT#IIF(CYOriginal EQ 0, IIF(Requested GT 0, DE("100.0"),
DE("0.0")),
NumberFormt(100*Change/CYOriginal, '_
CFOUTPUT#IIF(CYOriginal EQ 0, IIF(Requested GT 0, DE("100.0"),
DE("0.0")),
NumberFormt(100*Change/CYOriginal, '__._'))#/CFOUTPUT
The problem is that when CYOriginal EQ 0 the following code is run
NumberFormat(100*Change/CYOriginal, '__._')
and as CYOrigin
If I understand your problem,
1. you want to check for the existence of a variable
2. If the variable exists, then check against multiple values
3. display different HTML depending on value of variable
cfif ParameterExists(someVariable) !--- check for var existence ---
cfswitch
Except for one problem this code is perfect.
Don't use ParameterExists(). Use IsDefined("") instead.
--K
-Original Message-
From: Adrian J. Moreno [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 15, 2001 6:40 PM
To: CF-Talk
Subject: Re: iif with 3 expressions?
If I under
I may be stretching, but I was wondering if there is a way to use IIF() to
choose between 3 different expressions?
What I have is a variable that has 3 different possible values. I need to
test for the existence of a variable and display one of three images based
upon the value of the variable
cfswitch?
--K
-Original Message-
From: Jon Hall [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 12, 2001 9:39 PM
To: CF-Talk
Subject: iif with 3 expressions?
I may be stretching, but I was wondering if there is a way to use IIF() to
choose between 3 different expressions?
What I have
here's one way to do it:
#iif(
mything is "APPLE",
DE("pic_apple.gif"),
DE(
iif(mything is "BANANA",
DE("pic_banana.gif"),
DE("pic_cactus.gif")
Use CFSWITCH. It'll be the same speed as a single CFIF, and would
probably outperform IFF also.
Kevin
[EMAIL PROTECTED] 01/12/01 01:39PM
I may be stretching, but I was wondering if there is a way to use IIF()
to
choose between 3 different expressions?
What I have is a variable that has 3
Shouldn't these do the same thing (IIF more effeciently)...IIF is bombing
I have tried it w/ and w/o the delayed eval DE()...
#IIF(Len(conv_data.BankingSpecificLoansDeposits),
conv_data.BankingSpecificLoansDeposits, DE(''))#
cfif
len(conv_data.BankingSpecificRating
OK OK found it..needed a NULL
#IIF(Len(conv_data.BankingSpecificLoansDeposits),
conv_data.BankingSpecificLoansDeposits, DE('NULL'))#
From: "j p" [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Subject: Going Insane...IIF
Date: Fri, 06 Oct 2000 10
Actually..
#IIF(Len(conv_data.BankingSpecificLoansDeposits),
DE(conv_data.BankingSpecificLoansDeposits), DE("''"))#
Or something like that. ;)
Really cfif is alot better.
--
Archives: http://www.mail-arch
No. cfif is more efficient, and you need the DE()'s to produce reasonable
results for anything.
#IIF(Len(conv_data.BankingSpecificLoansDeposits),
DE(conv_data.BankingSpecificLoansDeposits), DE(''))#
I think that's right. But then I've been up since this time yesterday. But I
know that cfif
Try
#IIF(Len(conv_data.BankingSpecificLoansDeposits),
'conv_data.BankingSpecificLoansDeposits', DE(''))#
(single quotes around "true" epression)
-Original Message-
From: j p [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 06, 2000 11:24 AM
To: CF-Talk
Subject: Going In
IIF is less efficient than CFIF. Look here for a good rundown
(http://www.fusionauthority.com/iif.htm).
Shouldn't these do the same thing (IIF more effeciently)...IIF is bombing
I have tried it w/ and w/o the delayed eval DE()...
#IIF(Len(conv_data.BankingSpecificLoansDeposits
add 'FROM dual' at the end:
Access should work as SQL server but I have not tried months ago.
Jaime/
-Original Message-
From: Deanna L. Schneider [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 27, 2000 11:17 AM
To: CF-Talk
Subject: access iif count
Hi folks,
I'm trying to use
For Access try SUM instead of COUNT
cfquery name="countyesnos" datasource="#dsn#"
SELECT SUM(IIF(success = 1, 1, 0)) AS successyes,
SUM(IIF(success = 0, 1, 0)) AS successno
FROM survey
/cfquery
P.
-Original Message-
From: Jaime
Thanks Jaime,
But, it doesn't work. Syntax Error.
-d
Deanna Schneider
Interactive Media Developer
UWEX Cooperative Extension Electronic Publishing Group
103 Extension Bldg
432 N. Lake Street
Madison, WI 53706
(608) 265-7923
Thanks Peter. That did it. I swear I tried that. Oh well. Brain burp.
-Deanna
Deanna Schneider
Interactive Media Developer
UWEX Cooperative Extension Electronic Publishing Group
103 Extension Bldg
432 N. Lake Street
Madison, WI
Hi folks,
I'm trying to use IIF in a query to count a bunch of yes/no values. Here's
what I'm trying that doesn't work (both count the total rows):
cfquery name="countyesnos" datasource="#dsn#"
SELECT COUNT(IIF (success = 1, 1, 0)) as successyes,
COUNT(iif (success = 0,
101 - 200 of 226 matches
Mail list logo