you're right -- see the post from double-down which says where 1=2 so it
will always start out false...
then if either of the others is true, the OR will work

> -----Original Message-----
> From: Christopher Olive, CIO [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, September 28, 2000 11:45 AM
> To:   CF-Talk
> Subject:      RE: conditional where statement
> 
> only problem with that is that it will ALWAYS be true.  0 always equals 0.
> 
> chris olive, cio
> cresco technologies
> [EMAIL PROTECTED]
> http://www.crescotech.com
> 
> 
> 
> -----Original Message-----
> From: Dave Hannum [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 28, 2000 1:29 PM
> To: CF-Talk
> Subject: Re: conditional where statement
> 
> 
> You have to account for the fact that one or both or neither may be there:
> One way would be:
> 
> select *
> from tbl
> where 0 = 0
> <cfif isdefined("id")>
> or id = #id#
> </cfif>
> <cfif isdefined("name")>
> or name = '#name#'
> </cfif>
> 
>   The WHERE 0 = 0 simply is a dummy conditional that will keep you from
> crashing if neither variable is present and allows you to  use the or
> statement with both cases.  (Don't forget the single ticks around your
> name
> field - text you know)
> 
> Dave
> 
> 
> =================================
> "What we need is a list of specific unknown problems we will encounter"
> 
> David Hannum
> Web Analyst/Programmer
> Ohio University
> [EMAIL PROTECTED]
> (740) 597-2524
> 
> 
> 
> ----- Original Message -----
> From: "Dan Donnick" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[EMAIL PROTECTED]>
> Sent: Thursday, September 28, 2000 12:35 PM
> Subject: conditional where statement
> 
> 
> is this correct or am i missing something?
> 
> select *
> from tbl
> where <cfif isdefined(")>
> id = #id#
> </cfif>
> or
> <cfif isdefined(")>
> name = #name#
> </cfif>
> ______________________________
> 
> Dan Donnick
> Cold Fusion Developer
> Bixler Incorporated
> 1250 24th Street
> Suite 250
> Washington, DC 20037
> P: (202) 686-5800
> F: (202) 686-5801
> ______________________________
> 
> --------------------------------------------------------------------------
> --
> --
> 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.
------------------------------------------------------------------------------
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.

Reply via email to