Ask a Question related to Coldfusion Database Access, Design and Development.
-
Nat5 #1
Querying multiple fields
I want to create a query where data in one form field matches any of six other
fields the record is selected. Anyone have an example of how to write this?
Seems simple enough but nothing I'm doing works. I'm querying SQL.
cfif form.data EQ database.field1 or database.field2 or etc
Nat5 Guest
-
Changing the Value on multiple fields
Hi Folks, I have a database that, among other things, has a field called 'pos' - short for position. The idea is that via a form, I can change... -
multiple text fields
As frame5 is entered, multiple text fields are supposed to be created. I have 3 createTextFields. Each one works, if it's the only one I didin't... -
Search multiple keywords across multiple fields
Hi, I'm about halfway through building a search engine using ASP, SQL and Access. As part of that search engine I need to search multiple... -
Fill in multiple fields with AfterUpdate
Emilia, Sorry for the late response. My motherboard failed on me. The troubleshooting process took a greater portion of last week. Hardware... -
SQL Search Multiple Fields ??
James wrote: Yes. Well, just execute this SQL statement using the PHP extension for the SQL server you're using. By the way: how does... -
-
paross1 #3
Re: Querying multiple fields
I don't see a WHERE clause in your SELECT. Also, since you are joining two
tables, you are going to get a Cartesian join (number of rows equaling the
product of both tables) unless you relate the two tables to one another, either
in a JOIN or WHERE clause.
Phil
paross1 Guest
-
-
Nat5 #5
Re: Querying multiple fields
Thanks. I redid the some of it and left that out by accident.
I'm really trying to figure out this part:
<cfif isDefined("Form.certarea")>
AND appCert.cert1Area EQ '#form.certarea#'
</cfif>
I need form.certarea to not only match up with appCert.cert1 but also cert2,
cert3, cert4, cert5 and cert6 fields. I tried to use an OR but couldn't get it
to work. Can someone tell me if I should use OR - or is this even the right
way to search through more than one field? I have Ben Forta's web application
construction book but can't find an example.
Nat5 Guest
-
paross1 #6
Re: Querying multiple fields
First off, you wouldn't use EQ when comparing your database field against a
value, but would use = instead.
Perhaps, something like this:
<cfif isDefined("Form.ID") AND '#Form.ID#' is not "">
AND applicantTracking.ID = '#form.ID#'
</cfif>
<cfif isDefined("Form.certarea")>
AND (appCert.cert1Area = '#form.certarea#'
OR appCert.cert2Area = '#form.certarea#'
OR appCert.cert3Area = '#form.certarea#'
OR appCert.cert4Area = '#form.certarea#'
OR appCert.cert5Area = '#form.certarea#'
OR appCert.cert6Area = '#form.certarea#')
</cfif>
Phil
paross1 Guest
-



Reply With Quote

