Um, I think you're trying to do this:
select *
from tbl
where
<cfif isdefined("id")>
id = #id# </cfif>
or
<cfif isdefined("name")>
name = '#name#'
</cfif>
But, if these are the only two possibilities, then you'll need to do
something more like so:
select *
from table
<cfif isdefined("id") or isdefined("name")>
WHERE
<cfif isdefined("id") AND not isdefined("name")>
id = #id#
<cfelseif isdefined("id") AND isdefined("name")>
id = #id# OR name='#name#'
<cfelseif NOT isdefined("id") AND isdefined("name")>
name = #name#
</cfif>
</cfif>
Get it?
-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.