Your join issue was aleady answered - here is a little bit of info regarding
the CF your using.
Do not use IsDefined on form.title. This is an textbox, and will always be
defined. Only use IsDefined when using checkboxes and radio buttons which
will not be passed (are not defined) by the form unless some value is
specified.
Use the following when passing a form textbox in ColdFusion
<cfif len(form.title)> <!--- This evaluate to either 0 (false) or something
else (true) --->
AND
charles.title LIKE '%#form.title#%'
AND/OR (assuming both tables have a title field)
tremont.title LIKE '%#form.title#%'
</cfif>
----- Original Message -----
From: "Paul Campano" <[EMAIL PROTECTED]>
To: "SQL" <[EMAIL PROTECTED]>
Sent: Thursday, January 16, 2003 2:34 PM
Subject: Two table query issue
> I have two tables, tremont and charles I want to query info from both
tables, but filter the results based on form variables. Something like this
works
> fine:
>
> SELECT ID, category, title, format, store
> FROM charles
> WHERE 0=0
> <!--- conditions passed from search --->
> <cfif isdefined("form.title") IS "yes">
> <cfif form.title IS NOT "">
> AND title LIKE '#form.title#'
> </cfif>
> </cfif>
>
> but if I try this and add tremont, the second table, into the FROM clause
I get this error:
>
> The specified field 'ID' could refer to more than one table listed in the
FROM clause of your SQL statement.
>
> How can I get results from both tables and still be able to filter them
through the form variables? Thanks
>
>
> Paul
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=6
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=6
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm