It used to be, but is not so anymore, that IIF() was slower than
cfifcfelse/cfif.
It also used to be true, although I don't think it is any more, that all
of the expressions in an IIF() are evaluated even if not used. Not true
of cfif.
I know in older versions this would cause an error:
IIF() is shorthand replacement for IF/THEN/ELSE. Other langs have
IIF() too, eh?
Thus
cfif foo IS 5
foo is 5
cfelse
foo is not 5
/cfif
is equivalent to
IIF(foo IS 5, 'foo is 5', 'foo is not 5')
*note...mind the quotes! ' is double quote followed by single quote
DK
On 5/1/06, Matthew
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 PROTECTED]
Subject: Re: OT - IIF
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
Subject: OT - IIF
Thanks, John, but that's not really the problem, I don't think.
The query works if I use constants like this.
cfquery name="pullcount" datasource="#dbvar#"
SELECT IIF(10, sum(totalbirds), 0) AS weekbirds,
IIF(10, sum(totalbirds), 0) AS monthbirds,
IIF(10, sum(totalbirds), 0)AS yearbirds,
sighting, site, person WHERE sighting.site_id = site.site_id AND
site.per_id = person.per_id GROUP BY site.per_id, person.fname,
person.lname
- Original Message -
From: Deanna L. Schneider [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, May 04, 2000 20:06
Subject: Re: OT - IIF
6 matches
Mail list logo