Re: iif with 3 expressions?

2001-01-12 Thread Brendan Avery

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")
 )
 )
)#

please note the use of the DE() function.
also you don't need the whitespace -- i just added it for clarity.

At 04:39 PM 1/12/2001 -0500, you wrote:
>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.
>This is simple enough to do, but I really want to do it inline without
>having to make my loop any slower than it is.
>Any ideas?
>
>jon
>
>
>
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: iif with 3 expressions?

2001-01-12 Thread Katrina Chapman

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 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.
This is simple enough to do, but I really want to do it inline without
having to make my loop any slower than it is.
Any ideas?

jon
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



iif with 3 expressions?

2001-01-12 Thread Jon Hall

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.
This is simple enough to do, but I really want to do it inline without
having to make my loop any slower than it is.
Any ideas?

jon


~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: Going Insane...IIF

2000-10-06 Thread Michael Dinowitz

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),
> conv_data.BankingSpecificLoansDeposits, DE(''))#
>
> 
len(conv_data.BankingSpecificRating)>#conv_data.BankingSpecificRating#''
>
>
>
> ERROR-----
> An error occurred while evaluating the expression:
>
>
>
#IIF(Len(conv_data.BankingSpecificLoansDeposits),conv_data.BankingSpecificLo
ansDeposits,DE(''))#
>
>
>
> Error near line 428, column 6.
> --
--
>
> An error has occurred while processing the expression:
>
>
>
>
> The reason for the error is unknown.
>
>
>
> The error occurred while processing an
>
> _
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
> Share information about yourself, create your own public profile at
> http://profiles.msn.com.
>
> --

> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
>

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Going Insane...IIF

2000-10-06 Thread mherbene

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 Insane...IIF


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#''

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Going Insane...IIF

2000-10-06 Thread Ed Toon

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. But I
know that  is faster. ;)

Ed

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Going Insane...IIF

2000-10-06 Thread Ed Toon

Actually..

#IIF(Len(conv_data.BankingSpecificLoansDeposits), 
DE(conv_data.BankingSpecificLoansDeposits), DE("''"))#

Or something like that. ;)

Really  is alot better.
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: Going Insane...IIF (answer)

2000-10-06 Thread j p


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:24:28 CDT
>
>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(''))#
>
>len(conv_data.BankingSpecificRating)>#conv_data.BankingSpecificRating#''
>
>
>
>ERROR-
>An error occurred while evaluating the expression:
>
>
>#IIF(Len(conv_data.BankingSpecificLoansDeposits),conv_data.BankingSpecificLoansDeposits,DE(''))#
>
>
>
>Error near line 428, column 6.
>
>
>An error has occurred while processing the expression:
>
>
>
>
>The reason for the error is unknown.
>
>
>
>The error occurred while processing an
>
>_
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>Share information about yourself, create your own public profile at
>http://profiles.msn.com.
>
>--
>Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
>To Unsubscribe visit 
>http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or 
>send a message to [EMAIL PROTECTED] with 'unsubscribe' in 
>the body.

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Going Insane...IIF

2000-10-06 Thread j p

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#''



ERROR-
An error occurred while evaluating the expression:


#IIF(Len(conv_data.BankingSpecificLoansDeposits),conv_data.BankingSpecificLoansDeposits,DE(''))#



Error near line 428, column 6.


An error has occurred while processing the expression:




The reason for the error is unknown.



The error occurred while processing an

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: access iif & count

2000-09-28 Thread Deanna L. Schneider

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
(608) 265-7923



--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: access iif & count

2000-09-28 Thread Deanna L. Schneider

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-7923



--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: access iif & count

2000-09-28 Thread Deanna L. Schneider

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



--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: access iif & count

2000-09-28 Thread Peter Stolz

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
To: CF-Talk
Subject: RE: access iif & count


Power to the sub queries!

FOR SQL Server:

SELECT
(SELECT Count(*) FROM Survey WHERE success=1) as SuccessYes,
(SELECT Count(*) FROM Survey WHERE success=0) as SuccessNo,
(SELECT Count(*) FROM Survey WHERE OtherFlag=32) as CountThirtyTwos

For Oracle, same thing but you 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'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 could do this:
SELECT COUNT(success) as successyes
FROM survey
WHERE success = 1

to get the right answer, but I want to be able to do it for several yes/no
fields all in one query. I know I'm just putting something in the wrong
place or something. Help?



Deanna Schneider
Interactive Media Developer
UWEX Cooperative Extension Electronic Publishing Group
103 Extension Bldg
432 N. Lake Street
Madison, WI 53706
(608) 265-7923




--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.


--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: access iif & count

2000-09-27 Thread Peter Stolz

try this:

SELECT successyes = SUM(CASE success WHEN 1 THEN 1 ELSE NULL END),
 successno = SUM(CASE success WHEN 0 THEN 1 ELSE NULL END)
FROM survey


P.


-Original Message-
From: Deanna L. Schneider [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 27, 2000 2:17 PM
To: CF-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 successno
FROM survey

I know  I could do this:
SELECT COUNT(success) as successyes
FROM survey
WHERE success = 1

to get the right answer, but I want to be able to do it for several yes/no
fields all in one query. I know I'm just putting something in the wrong
place or something. Help?



Deanna Schneider
Interactive Media Developer
UWEX Cooperative Extension Electronic Publishing Group
103 Extension Bldg
432 N. Lake Street
Madison, WI 53706
(608) 265-7923




--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: access iif & count

2000-09-27 Thread Jaime Garza

Power to the sub queries!

FOR SQL Server:

SELECT
(SELECT Count(*) FROM Survey WHERE success=1) as SuccessYes,
(SELECT Count(*) FROM Survey WHERE success=0) as SuccessNo,
(SELECT Count(*) FROM Survey WHERE OtherFlag=32) as CountThirtyTwos

For Oracle, same thing but you 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'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 could do this:
SELECT COUNT(success) as successyes
FROM survey
WHERE success = 1

to get the right answer, but I want to be able to do it for several yes/no
fields all in one query. I know I'm just putting something in the wrong
place or something. Help?



Deanna Schneider
Interactive Media Developer
UWEX Cooperative Extension Electronic Publishing Group
103 Extension Bldg
432 N. Lake Street
Madison, WI 53706
(608) 265-7923




--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



access iif & count

2000-09-27 Thread Deanna L. Schneider

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 could do this:
SELECT COUNT(success) as successyes
FROM survey
WHERE success = 1

to get the right answer, but I want to be able to do it for several yes/no
fields all in one query. I know I'm just putting something in the wrong
place or something. Help?



Deanna Schneider
Interactive Media Developer
UWEX Cooperative Extension Electronic Publishing Group
103 Extension Bldg
432 N. Lake Street
Madison, WI 53706
(608) 265-7923



--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Can't work out IIF/IsDefined quirk

2000-08-29 Thread Scott, Andrew

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 quirk



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 Internet leveraging software at:
http://www.deerfield.com

> -Original Message-
> From: Paul Johnston [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 29, 2000 9:20 AM
> To: Cf-Talk
> Subject: Can't work out IIF/IsDefined quirk
>
>
> 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 resolving parameter FORM.CATEGORIES
>
> The specified form field cannot be found. This problem is very
> likely due to
> the fact that you have misspelled the form field name.
>
> It's supposed to check if it's been defined, and then if it has output it,
> and if it hasn't, output nothing.
>
> IT'S NOT WORKING!
>
> Anyone any idea why?
>
> Paul
>
>
> --
> 
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf
_talk or send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body.



--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Can't work out IIF/IsDefined quirk

2000-08-29 Thread Bud

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. :)
-- 

Bud Schneehagen - Tropical Web Creations

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
ColdFusion Solutions / eCommerce Development
[EMAIL PROTECTED]
http://www.twcreations.com/
954.721.3452
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Can't work out IIF/IsDefined quirk

2000-08-29 Thread Geoffrey V. Brown


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.

> -Original Message-
> From: Bud [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 29, 2000 10:26 AM
> To: [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't use isdefined in an IIF. If it's not defined it will
> still try and reference the variable and return an error. If you must
> use isdefined, you'll need to use a real cfif.
>
> What you can do is this:
>
> 
> 
> 
> 
> 
>
> IIf(variables.categories is "", DE(''), DE(variables.categories))#
>
> Or:
>
> IIf(variables.categories is "", DE(''), DE('#variables.categories#'))#
> --
>
> Bud Schneehagen - Tropical Web Creations
>
> _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
> ColdFusion Solutions / eCommerce Development
> [EMAIL PROTECTED]
> http://www.twcreations.com/
> 954.721.3452
> --
> 
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf
_talk or send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body.


--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Can't work out IIF/IsDefined quirk

2000-08-29 Thread Chapman, Katrina

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 returns the value of Evaluate(string_expression1); otherwise, it returns
the value of Evaluate(string_expression2)."

The syntax is "IIf(condition, string_expression1, string_expression2)".

So in this case if the variable does in fact exist then it will evaluate
String1.  Otherwise it does string2.

HTH,
--K



-Original Message-
From: Paul Johnston [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 29, 2000 7:42 AM
To: [EMAIL PROTECTED]
Subject: RE: Can't work out IIF/IsDefined quirk


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:[EMAIL PROTECTED]]
> Sent: 29 August 2000 15:26
> To: [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't use isdefined in an IIF. If it's not defined it will
> still try and reference the variable and return an error. If you must
> use isdefined, you'll need to use a real cfif.
>
> What you can do is this:
>
> 
> 
> 
> 
> 
>
> IIf(variables.categories is "", DE(''), DE(variables.categories))#
>
> Or:
>
> IIf(variables.categories is "", DE(''), DE('#variables.categories#'))#
> --
>
> Bud Schneehagen - Tropical Web Creations
>
> _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
> ColdFusion Solutions / eCommerce Development
> [EMAIL PROTECTED]
> http://www.twcreations.com/
> 954.721.3452
> --
> 
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.



--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Can't work out IIF/IsDefined quirk

2000-08-29 Thread Paul Johnston

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:[EMAIL PROTECTED]]
> Sent: 29 August 2000 15:26
> To: [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't use isdefined in an IIF. If it's not defined it will
> still try and reference the variable and return an error. If you must
> use isdefined, you'll need to use a real cfif.
>
> What you can do is this:
>
> 
> 
> 
> 
> 
>
> IIf(variables.categories is "", DE(''), DE(variables.categories))#
>
> Or:
>
> IIf(variables.categories is "", DE(''), DE('#variables.categories#'))#
> --
>
> Bud Schneehagen - Tropical Web Creations
>
> _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
> ColdFusion Solutions / eCommerce Development
> [EMAIL PROTECTED]
> http://www.twcreations.com/
> 954.721.3452
> --
> 
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.


--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Can't work out IIF/IsDefined quirk

2000-08-29 Thread Bud

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 error. If you must 
use isdefined, you'll need to use a real cfif.

What you can do is this:







IIf(variables.categories is "", DE(''), DE(variables.categories))#

Or:

IIf(variables.categories is "", DE(''), DE('#variables.categories#'))#
-- 

Bud Schneehagen - Tropical Web Creations

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
ColdFusion Solutions / eCommerce Development
[EMAIL PROTECTED]
http://www.twcreations.com/
954.721.3452
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Can't work out IIF/IsDefined quirk

2000-08-29 Thread Andy Ewings

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]]
Sent: 29 August 2000 14:30
To: [EMAIL PROTECTED]
Subject: RE: Can't work out IIF/IsDefined quirk



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 Internet leveraging software at:
http://www.deerfield.com

> -Original Message-
> From: Paul Johnston [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 29, 2000 9:20 AM
> To: Cf-Talk
> Subject: Can't work out IIF/IsDefined quirk
>
>
> 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 resolving parameter FORM.CATEGORIES
>
> The specified form field cannot be found. This problem is very
> likely due to
> the fact that you have misspelled the form field name.
>
> It's supposed to check if it's been defined, and then if it has output it,
> and if it hasn't, output nothing.
>
> IT'S NOT WORKING!
>
> Anyone any idea why?
>
> Paul
>
>
> --
> 
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf
_talk or send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body.



--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Can't work out IIF/IsDefined quirk

2000-08-29 Thread Geoffrey V. Brown


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 Internet leveraging software at:
http://www.deerfield.com

> -Original Message-
> From: Paul Johnston [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 29, 2000 9:20 AM
> To: Cf-Talk
> Subject: Can't work out IIF/IsDefined quirk
>
>
> 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 resolving parameter FORM.CATEGORIES
>
> The specified form field cannot be found. This problem is very
> likely due to
> the fact that you have misspelled the form field name.
>
> It's supposed to check if it's been defined, and then if it has output it,
> and if it hasn't, output nothing.
>
> IT'S NOT WORKING!
>
> Anyone any idea why?
>
> Paul
>
>
> --
> 
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf
_talk or send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body.


--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Can't work out IIF/IsDefined quirk

2000-08-29 Thread Paul Johnston

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 resolving parameter FORM.CATEGORIES

The specified form field cannot be found. This problem is very likely due to
the fact that you have misspelled the form field name.

It's supposed to check if it's been defined, and then if it has output it,
and if it hasn't, output nothing.

IT'S NOT WORKING!

Anyone any idea why?

Paul


--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: dynamic IIf

2000-08-21 Thread Jamie Keane

Oh, my mistake... I forgot the DE()'s around the results.  These are needed.
My brain's fried today. :)

--
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  Fax
-Original 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"
>
>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: Monday, August 21, 2000 11:53 AM
>*  To: [EMAIL PROTECTED]
>*  Subject: Re: dynamic IIf
>*
>*
>*  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  Fax
>*  -Original Message-
>*  From: Peter Benoit <[EMAIL PROTECTED]>
>*  To: '[EMAIL PROTECTED]' <[EMAIL PROTECTED]>
>*  Date: Monday, August 21, 2000 11:41 AM
>*  Subject: dynamic IIf
>*
>*
>*  >
>*  >Having a hard time with this:
>*  >
>*  >*  else"#">
>*  >
>*  >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
>*  http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lis
>ts/cf_talk or
>send a message to [EMAIL PROTECTED] with 'unsubscribe' in
>the body.
>
>---
-
>--
>Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
>To Unsubscribe visit
>http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
>send a message to [EMAIL PROTECTED] with 'unsubscribe' in
>the body.
>
>---
---
>Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
>To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: dynamic IIf

2000-08-21 Thread Cary Gordon

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 wrote:

>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 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: dynamic IIf

2000-08-21 Thread Peter Benoit

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: Monday, August 21, 2000 11:53 AM
*  To: [EMAIL PROTECTED]
*  Subject: Re: dynamic IIf
*  
*  
*  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  Fax
*  -Original Message-
*  From: Peter Benoit <[EMAIL PROTECTED]>
*  To: '[EMAIL PROTECTED]' <[EMAIL PROTECTED]>
*  Date: Monday, August 21, 2000 11:41 AM
*  Subject: dynamic IIf
*  
*  
*  >
*  >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
*  http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lis
ts/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.


--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: dynamic IIf

2000-08-21 Thread Jamie Keane

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  Fax
-Original Message-
From: Peter Benoit <[EMAIL PROTECTED]>
To: '[EMAIL PROTECTED]' <[EMAIL PROTECTED]>
Date: Monday, August 21, 2000 11:41 AM
Subject: dynamic IIf


>
>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
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



dynamic IIf

2000-08-21 Thread Peter Benoit


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 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: IIf() and DE confusion

2000-07-10 Thread Michael Dinowitz

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 reason
I prefer to use quotes in place of DE functions. Saves the problems.

> Thanks, Michael.  The first two approaches work correctly, but the third
> doesn't.  It throws an error as it tries to evaluate CreateODBCDate() if
> the field is left blank.
>
> Jim
>
>
> -Original Message-
> From: Michael Dinowitz <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> 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 look like one of these:
> >
> >#IIF(IsDate(form.thedate), 'CreateODBCDate(form.thedate)', DE('NULL'))#
> >#IIF(IsDate(form.thedate), DE(CreateODBCDate(form.thedate)), DE('NULL'))#
> >
> >More information on this can be found here:
> >http://www.fusionauthority.com/IIF.cfm
> >
> >
> >> 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 =  >> IsDate(form.thedate)>#CreateODBCDate(form.thedate)#NULL
> >>
> >> Thanks,
> >> Jim
>
>
> --

> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
>

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: IIf() and DE confusion

2000-07-10 Thread Jim McAtee

Thanks, Michael.  The first two approaches work correctly, but the third
doesn't.  It throws an error as it tries to evaluate CreateODBCDate() if
the field is left blank.

Jim


-Original Message-
From: Michael Dinowitz <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
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 look like one of these:
>
>#IIF(IsDate(form.thedate), 'CreateODBCDate(form.thedate)', DE('NULL'))#
>#IIF(IsDate(form.thedate), DE(CreateODBCDate(form.thedate)), DE('NULL'))#
>
>More information on this can be found here:
>http://www.fusionauthority.com/IIF.cfm
>
>
>> 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 = > IsDate(form.thedate)>#CreateODBCDate(form.thedate)#NULL
>>
>> Thanks,
>> Jim


--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: IIf() and DE confusion

2000-07-10 Thread Michael Dinowitz

Sorry, missed the use in the wrap. The code would actually be:

or



More information on this can be found here:
http://www.fusionauthority.com/IIF.cfm


> 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 =  IsDate(form.thedate)>#CreateODBCDate(form.thedate)#NULL
>
> Thanks,
> Jim
>
>
> --

> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
>


--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.


--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: IIf() and DE confusion

2000-07-10 Thread Michael Dinowitz

#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)', DE('NULL'))#
#IIF(IsDate(form.thedate), DE(CreateODBCDate(form.thedate)), DE('NULL'))#

More information on this can be found here:
http://www.fusionauthority.com/IIF.cfm


> 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 =  IsDate(form.thedate)>#CreateODBCDate(form.thedate)#NULL
>
> Thanks,
> Jim
>
>
> --

> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
>

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: IIf() and DE confusion

2000-07-10 Thread Jim McAtee

Nope, if left blank, CF tries to evaluate CreateODBCDate() and generates
an error:

Error Diagnostic Information
Parameter 1 of function CreateODBCDate which is now "" must be a date/time
value

Jim


-Original Message-
From: Bryan Batchelder <[EMAIL PROTECTED]>
To: '[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_01BFEAAC.DB4262B0
>Content-Type: text/plain;
> charset="iso-8859-1"
>
>shouldn't this work?:
>
>iif(IsDate(form.thedate), DE(#CreateODBCDate(form.thedate)#), DE(""))
>
>--b
>
>p.s.  if you ever think you have it badhere is an iif that took a few
>hours of my time and about 15 minutes of a colleagues:
>
>iif(query.red_flag[rowNbr], DE(caller.pqa & '/redflag.gif'),
>iif(query.close_flag[rowNbr], ""DE(iif(query.won_flag[rowNbr],
DE(caller.pqa
>& '/thumbs_up.gif'), DE(caller.pqa & '/thumbs_down.gif')))"",
>""DE(caller.pqa & '/transpix.gif')""))
>
>Laterz.
>
>
>Bryan D. Batchelder   Work: 813-935-7100
>Palm/Internet Developer   Home: 727-547-1322
>
>ConnectWise, Inc. (www.ConnectWise.com)
>2803 West Busch Blvd, Suite 204
>Tampa, FL 33618
>
>
>-Original Message-
>From: Jim McAtee [mailto:[EMAIL PROTECTED]]
>Sent: Monday, July 10, 2000 4:15 PM
>To: [EMAIL PROTECTED]
>Subject: IIf() and DE confusion
>
>
>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 = IsDate(form.thedate)>#CreateODBCDate(form.thedate)#NULL
>
>Thanks,
>Jim

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: IIf() and DE confusion

2000-07-10 Thread Bryan Batchelder

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(form.thedate), DE(#CreateODBCDate(form.thedate)#), DE(""))

--b

p.s.  if you ever think you have it badhere is an iif that took a few
hours of my time and about 15 minutes of a colleagues:

iif(query.red_flag[rowNbr], DE(caller.pqa & '/redflag.gif'),
iif(query.close_flag[rowNbr], ""DE(iif(query.won_flag[rowNbr], DE(caller.pqa
& '/thumbs_up.gif'), DE(caller.pqa & '/thumbs_down.gif')))"",
""DE(caller.pqa & '/transpix.gif')""))

Laterz.


Bryan D. Batchelder   Work: 813-935-7100
Palm/Internet Developer   Home: 727-547-1322

ConnectWise, Inc. (www.ConnectWise.com)
2803 West Busch Blvd, Suite 204
Tampa, FL 33618


-Original Message-
From: Jim McAtee [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 10, 2000 4:15 PM
To: [EMAIL PROTECTED]
Subject: IIf() and DE confusion


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

Thanks,
Jim



--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

------_=_NextPart_001_01BFEAAC.DB4262B0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable






RE: IIf() and DE confusion



shouldn't this work?:


iif(IsDate(form.thedate), =
DE(#CreateODBCDate(form.thedate)#), DE(""))


--b


p.s.  if you ever think you have it badhere =
is an iif that took a few hours of my time and about 15 minutes of a =
colleagues:

iif(query.red_flag[rowNbr], DE(caller.pqa & =
'/redflag.gif'), iif(query.close_flag[rowNbr], =
""DE(iif(query.won_flag[rowNbr], DE(caller.pqa & =
'/thumbs_up.gif'), DE(caller.pqa & =
'/thumbs_down.gif')))"", ""DE(caller.pqa & =
'/transpix.gif')""))

Laterz.



Bryan D. =
Batchelder   Work: =
813-935-7100
Palm/Internet Developer   Home: =
727-547-1322

ConnectWise, Inc. (www.ConnectWise.com)
2803 West Busch Blvd, Suite 204
Tampa, FL 33618



-Original Message-
From: Jim McAtee [mailto:[EMAIL PROTECTED]">mailto:[EMAIL PROTECTED]=
]
Sent: Monday, July 10, 2000 4:15 PM
To: [EMAIL PROTECTED]
Subject: IIf() and DE confusion



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 =3D <cfif
IsDate(form.thedate)>#CreateODBCDate(form.thedate)#<cfels=
e>NULL</cfif>


Thanks,
Jim



---=
---
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/" =
TARGET=3D"_blank">http://www.mail-archive.com/cf-talk@houseoffusion.com/=

To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=3Dlists&body=3Dli=
sts/cf_talk" =
TARGET=3D"_blank">http://www.houseoffusion.com/index.cfm?sidebar=3Dlists=
&body=3Dlists/cf_talk or send a message to =
[EMAIL PROTECTED] with 'unsubscribe' in the =
body.



--_=_NextPart_001_01BFEAAC.DB4262B0--
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



IIf() and DE confusion

2000-07-10 Thread Jim McAtee

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

Thanks,
Jim


--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: OT - IIF function in Access

2000-05-04 Thread Paul Wakefield

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 function in Access
> 
> 
> 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_id,
>   person.fname,
>   person.lname
> FROM 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
> 
> 
> 
> But if I try to throw a variable in thereit doesn't work. 
> More thoughts?
> -d
> 
> 
> 
> [Microsoft][ODBC Microsoft Access Driver] Syntax error 
> (missing operator) in
> query expression 'IIF(site_date < #4/27/2000# sum(totalbirds), 0)'.
> 
> 
> SQL = "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.fname, 
> person.lname
> FROM 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"
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



IIF Solution

2000-05-04 Thread Deanna L. Schneider

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(site_date BETWEEN #now()# and #createodbcdate(year)#, totalbirds,
0)) AS yearbirds,
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
GROUP BY site.per_id, person.fname, person.lname


Ugly, but functional.

Thanks anyway.
-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



--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: OT - IIF function in Access

2000-05-04 Thread David E. Crawford

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.fname, person.lname
FROM 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 function in Access


> 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_id,
>   person.fname,
>   person.lname
> FROM 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
> 
>
>
> But if I try to throw a variable in thereit doesn't work. More
> thoughts?
> -d
>
>
>
> [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing
> operator) in
> query expression 'IIF(site_date < #4/27/2000# sum(totalbirds), 0)'.
>
>
> SQL = "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.fname, person.lname
> FROM 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"
>
>
>
>
> 
> Deanna Schneider
> Interactive Media Developer
> UWEX Cooperative Extension Electronic Publishing Group
> 103 Extension Bldg
> 432 N. Lake Street
> Madison, WI 53706
> (608) 265-7923
>
>
>
> 
> --
> Archives: http://www.eGroups.com/list/cf-talk
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
> or send a message to [EMAIL PROTECTED] with
> 'unsubscribe' in the body.
>

--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: OT - IIF function in Access

2000-05-04 Thread Deanna L. Schneider

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_id,
  person.fname,
  person.lname
FROM 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



But if I try to throw a variable in thereit doesn't work. More thoughts?
-d



[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in
query expression 'IIF(site_date < #4/27/2000# sum(totalbirds), 0)'.


SQL = "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.fname, person.lname
FROM 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"





Deanna Schneider
Interactive Media Developer
UWEX Cooperative Extension Electronic Publishing Group
103 Extension Bldg
432 N. Lake Street
Madison, WI 53706
(608) 265-7923



--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: OT - IIF function in Access

2000-05-04 Thread John N Westerlund

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 function in Access


Hi folks, this is a bit OT, but I thought there might be a better way to do
what's not working in CF anyway, so here it is:

I have the following code:





SELECT  SUM(totalbirds) AS weekbirds,
  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  site.site_date between #now()# AND #createodbcdate(month)#
GROUP BY site.per_id, person.fname, person.lname


It works fine, but what I want to do is pull the bird counts for the week,
the month and the year. I think I should be able to do it 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.fname, person.lname


But, what I get is this lovely error:
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in
query expression 'IIF(site.site_date between #5/4/2000 14:04:35# AND
#4/4/2000#, SUM(totalbirds) AS monthbirds, 0)'.

Help?

TIA,
Deanna


Deanna Schneider
Interactive Media Developer
UWEX Cooperative Extension Electronic Publishing Group
103 Extension Bldg
432 N. Lake Street
Madison, WI 53706
(608) 265-7923




--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.


--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



OT - IIF function in Access

2000-05-04 Thread Deanna L. Schneider

Hi folks, this is a bit OT, but I thought there might be a better way to do
what's not working in CF anyway, so here it is:

I have the following code:





SELECT  SUM(totalbirds) AS weekbirds,
  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  site.site_date between #now()# AND #createodbcdate(month)#
GROUP BY site.per_id, person.fname, person.lname


It works fine, but what I want to do is pull the bird counts for the week,
the month and the year. I think I should be able to do it 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.fname, person.lname


But, what I get is this lovely error:
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in
query expression 'IIF(site.site_date between #5/4/2000 14:04:35# AND
#4/4/2000#, SUM(totalbirds) AS monthbirds, 0)'.

Help?

TIA,
Deanna


Deanna Schneider
Interactive Media Developer
UWEX Cooperative Extension Electronic Publishing Group
103 Extension Bldg
432 N. Lake Street
Madison, WI 53706
(608) 265-7923



--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



<    1   2   3