Hi Greg,

<CFIF Form.OlderThan AND Form.YoungerThan>
   AND dob BETWEEN DateAdd(Year,#Form.OlderThan#,dob) AND
DateAdd(Year,#Form.YoungerThan#,dob)
<cfif> <-- this should be a closing cfif tag!

Seeeeya,
Adam



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Wednesday, 19 March 2003 2:10 PM
To: CFAussie Mailing List
Subject: [cfaussie] Re: look up date by years old with a 2 year spread <
2 > 2


Hi steve

still got the error
if i remove the red part of the query it runs fine , so its something in
that part of the code thats falling over.



<cfset Form.OlderThan =5>
<cfset Form.YoungerThan =1>
<cfset form.search = "yes">
<cfset form.gender = "male">
<cfset form.hair = "">

<CFQUERY name="getRecord" dataSource="interact">
 SELECT  Talent.talentID ,  
   Talent.Name , 
   Talent.Gender , 
   Talent.DOB , 
   Talent.Hair , 
   Talent.Eye , 
   Talent.Height , 
   Talent.Clothssize , 
   Talent.shoesize , 
   Talent.hobbies , 
   Talent.BIO , 
   Talent.Compcard , 
   Talent.ID
 FROM  Talent
 WHERE 1=1
 <CFIF ParameterExists(url.ID)>
 AND Talent.ID = #url.ID#
 </CFIF>
 
<CFIF ParameterExists(form.search)>
  AND Talent.gender = '#form.gender#'
  
REMOVED THIS BIT AND I GET NO ERROR ON <CFIF
ParameterExists(form.search)>
<!--- Check for age --->
  <!--- If we want an age range --->
  <CFIF Form.OlderThan AND Form.YoungerThan>
   AND dob BETWEEN DateAdd(Year,#Form.OlderThan#,dob) AND
DateAdd(Year,#Form.YoungerThan#,dob)
  <cfif>
  <!--- If we want all people younger than an age --->
  <cfif Form.YoungerThan AND NOT Form.OlderThan>
   AND dob < DateAdd(Year,#Form.YoungerThan#,dob)
  </cfif>
  <!--- If we want all people older than an age --->
  <cfif NOT Form.YoungerThan AND Form.OlderThan>
   AND dob > DateAdd(Year,#Form.OlderThan#,dob)
  </cfif>
   
   <CFIF form.hair IS NOT "">
   and talent.hair = '#form.hair#'
   </CFIF>
   
   
</CFIF>

</CFQUERY>

Regards greg
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/ 


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

Reply via email to