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")
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
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
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.BankingS
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-Ta
No. 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. B
Actually..
#IIF(Len(conv_data.BankingSpecificLoansDeposits),
DE(conv_data.BankingSpecificLoansDeposits), DE("''"))#
Or something like that. ;)
Really is alot better.
--
Archives: http://www.mail
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 Insan
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(''))#
#conv_data.BankingSpecificRating#''
ERR
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 53706
Nope, Peter, that doesn't work either. Thanks for the try.
-Deanna
Deanna Schneider
Interactive Media Developer
UWEX Cooperative Extension Electronic Publishing Group
103 Extension Bldg
432 N. Lake Street
Madison, WI 53706
(608) 265-
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
-
For Access try SUM instead of COUNT
SELECT SUM(IIF(success = 1, 1, 0)) AS successyes,
SUM(IIF(success = 0, 1, 0)) AS successno
FROM survey
P.
-Original Message-
From: Jaime Garza [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 27, 2000 7:24 PM
-Talk
Subject: access iif & count
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):
SELECT COUNT(IIF (success = 1, 1, 0)) as successyes,
COUNT(iif (success = 0, 1, 0)) as
add 'FROM dual' at the end:
Access should work as SQL server but I have not tried months ago.
-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'
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):
SELECT COUNT(IIF (success = 1, 1, 0)) as successyes,
COUNT(iif (success = 0, 1, 0)) as successno
FROM survey
I know I c
Or it would look nicer to use ...
regards
Andrew Scott
ANZ eCommerce Centre
* Ph 9273 0693
* [EMAIL PROTECTED]
-Original Message-
From: Geoffrey V. Brown [mailto:[EMAIL PROTECTED]]
Sent: 30 August 2000 00:30
To: [EMAIL PROTECTED]
Subject: RE: Can't work out IIF/IsDefined
On 8/29/00, Geoffrey V. Brown penned:
>Hi,
>Don't mean to disagree, but give that line of code a shot, I use it
>everywhere in my scripts! You must use double quotes around the variable
>name though.
I stand corrected sir!
That's why I love this list. Now if I can just remember that. :)
--
Bu
[EMAIL PROTECTED]
> Subject: RE: Can't work out IIF/IsDefined quirk
>
>
> On 8/29/00, Geoffrey V. Brown penned:
> >Hi,
> >Use this:
> >
> >#IIF(isdefined("form.categories"), "form.categories", de(''))#
>
> Sorry. You can
Paul,
You're right you can use IsDefined in an IIf. I do it all the time. BTW
you should probably also trim the form.fieldname.
IE:
The form fieldname equals something.
Bud,
>From the docs.
"The function evaluates its condition as a Boolean. If the result is TRUE,
it retu
If I can't use IsDefined with IIF, how come the code I was given works then?
;)
As far as I am aware, IIF will work with any boolean expression, and
IsDefined is probably the most useful boolean function around in CF.
Paul
> -Original Message-
> From: Bud [mailto:[EMAI
On 8/29/00, Geoffrey V. Brown penned:
>Hi,
>Use this:
>
>#IIF(isdefined("form.categories"), "form.categories", de(''))#
Sorry. You can't use isdefined in an IIF. If it's not defined it will
still try and reference the variable and return an e
I think that will return the string "form.categories" instead of the value
of the variable. I would have said to try:
IIF(isdefined("#form.categories#"), #form.categories#, de(''))
-Original Message-
From: Geoffrey V. Brown [mailto:[EMAIL PROTECTED]]
Hi,
Use this:
#IIF(isdefined("form.categories"), "form.categories", de(''))#
Thanks,
Geoffrey Vail Brown
__
Director of Online Operations
Deerfield.com
231.935.4640
[EMAIL PROTECTED]
Check out our complete line of Interne
I got this:
Error Diagnostic Information
An error occurred while evaluating the expression:
#IIF(IsDefined("form.categories"), form.categories, DE(''))#
Error near line 51, column 11.
Error
al Message-
From: Peter Benoit <[EMAIL PROTECTED]>
To: '[EMAIL PROTECTED]' <[EMAIL PROTECTED]>
Date: Monday, August 21, 2000 12:03 PM
Subject: RE: dynamic IIf
>Well that's what I have
>
>IIF(url.stuff IS "whatever"
>
>then "something"
>
Without seeing an example of your code, my best guess is that you are
likely doing something which requires the use of DE() (the delayed
evaluation function) it the actions. The Iif() function raises some timing
issues which are ameliorated by DE().
Cary
At 11:43 AM 8/21/2000 -0400, you
Well that's what I have
IIF(url.stuff IS "whatever"
then "something"
else "something else")
which is what my line of code essentially says. Though it doesn't work :/
* -Original Message-
* From: Jamie Keane [mailto:[EMAIL PROTECTED]]
* Sent
The syntax should be IIF(condition,result1,result2)
where result1 occurs if condition is true and result2 occurs if condition is
false.
--
Jamie Keane
Programmer
SolutionMasters, Inc.
9111 Monroe Rd., Suite 100
Charlotte, NC 28270
www.solutionmasters.com
704.563.5559 x 228 Voice
704.849.9291
Having a hard time with this:
Tried mixing things up a bit (quotes, pound signs) with no success. Any
suggestions?
TIA,
Pete
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
True, it would. The problem with IIF is that its a function. Before a
function evaluates, any subfunctions AND variables inside it are evaluated.
When using the DE functions, it tried to evaluate what was in it, which was
a function. This failed, causing the whole thing to fail. This is the
OTECTED]>
Date: Monday, July 10, 2000 3:16 PM
Subject: Re: IIf() and DE confusion
>#IIF(IsDate(form.thedate), 'CreateODBCDate(form.thedate)', '''NULL''')#
>
>Note the use of single and multiple quotes here in place of DE. Using DE
>instead will
se might be needed.
> I'm trying to use IIf() in a SQL statement instead of the following:
>
> thedate = IsDate(form.thedate)>#CreateODBCDate(form.thedate)#NULL
>
> Thanks,
> Jim
>
>
> --
-
#IIF(IsDate(form.thedate), 'CreateODBCDate(form.thedate)', '''NULL''')#
Note the use of single and multiple quotes here in place of DE. Using DE
instead will look like one of these:
#IIF(IsDate(form.thedate), 'CreateODBCDate(form.thedate)
#x27;[EMAIL PROTECTED]' <[EMAIL PROTECTED]>
Date: Monday, July 10, 2000 2:25 PM
Subject: RE: IIf() and DE confusion
>This message is in MIME format. Since your mail reader does not
understand
>this format, some or all of this message may not be legible.
>
>--_=_NextPart_001
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--_=_NextPart_001_01BFEAAC.DB4262B0
Content-Type: text/plain;
charset="iso-8859-1"
shouldn't this work?:
iif(IsDate(fo
I know this can be done, but I'll be hanged if I can figure out the right
combination of DE() and ## and quotes and whatever else might be needed.
I'm trying to use IIf() in a SQL statement instead of the following:
thedate = #CreateODBCDate(form.thedate)#NULL
T
I think you've got the SUM and IIF nested the wrony way 'round - try
SUM(IIF(site_date < {d '2000-04-27'}, totalbirds, 0))
> -Original Message-
> From: Deanna L. Schneider [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 04, 2000 10:07 PM
> To: [EMAIL
Hi all. For those that are curious, I figured out my IIF problem. This is
the solution:
SELECT SUM(IIF(site_date BETWEEN #now()# and #createodbcdate(week)#,
totalbirds, 0)) AS weekbirds,
SUM(IIF(site_date BETWEEN #now()# and #createodbcdate(month)#, totalbirds,
0)) AS monthbirds,
SUM(IIF
Missing comma in this piece (right before sum(totalbirds). Change that and
see what happens.
SELECT IIF(site_date < {d '2000-04-27'} sum(totalbirds), 0) AS
weekbirds, IIF(1>0, sum(totalbirds), 0) AS monthbirds, IIF(1>0,
sum(totalbirds), 0)AS yearbirds, site.per_id, person.
Thanks, John, but that's not really the problem, I don't think.
The query works if I use constants like this.
SELECT IIF(1>0, sum(totalbirds), 0) AS weekbirds,
IIF(1>0, sum(totalbirds), 0) AS monthbirds,
IIF(1>0, sum(totalbirds), 0)AS yearbirds,
site.per
I usually see the query coded as:
AND site_date < #date1#
AND site_date > #now()#
Primitive I know, but tried and true :-)
-Original Message-
From: Deanna L. Schneider <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Thursday, May 04, 2000 3:10 PM
with something
like:
SELECT IIF(site.site_date between #now()# AND #createodbcdate(month)#,
SUM(totalbirds) AS monthbirds, 0),
site.per_id, person.fname, person.lname
FROM sighting, site, person
WHERE sighting.site_id = site.site_id
AND site.per_id = person.per_id
AND GROUP BY site.per_id, person.
201 - 243 of 243 matches
Mail list logo