View Single Post
  #1  
Old 07-03-2002, 11:29 AM
Aemon_ Aemon_ is offline
Platinium Techie
 
Join Date: Apr 2002
Location: Brandon, UK
Posts: 928
Send a message via AIM to Aemon_
Default SQL problem! help!

ok people, i've been messing with this for a few days, and just cant figure it out.  its a stupid easy problem i think, that i just cant figure it out!  grrrr, one of those days.  ok, i want to search two fields in my database, from one dropdown box.  if thats not a very clear explaniation, heres what i have in the way of code right now.  i'm using coldfusion by the way.

<cfquery datasource="mapbase" name="mapdb">
SELECT      ALAV, MUNICI, COUNTY, LNUMBER, BIBTITLE, MAINTRY, DATE, SUBHEAD1, SUBHEAD2, SUBHEAD3
FROM         Mapdb
WHERE 0=0
<cfif #form.sub3# is not "">
AND SUBHEAD1 LIKE '%#FORM.sub3#%'
OR SUBHEAD2 LIKE '%#FORM.sub3#%'
</cfif>

</cfquery>

any and all help is very very very appreciated guys. thanks!

later.
__________________

Reply With Quote