But you are referencing the DOB field within the query:

 

"Talent.DOB"

 

Are you sure all of the selected fields within the query do indeed exist in the table?

 

There is a spelling error in Talent.Clothssize - is this how you have spelt it in the table?

 

As the error suggests, one of the fields you are referencing either doesn't exist in the table or is misspelt.

 

Double double check em :/

 

 

Sarah Atkinson
Global Applications Team Leader

Lonely Planet Publications, Aust.
Telephone: +61 3 8379 8000
[EMAIL PROTECTED]

 

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

 

Hi this is the exact code.

and current error message.

 

My thinking is its the dob field is not being reference in the query.

 

all i want to do is get all records between the age of  say 2 years old and 4 years old based on the value in the database DOB which is the date of birth  eg 18/03/2000 this record would be selected as well as anyother that fell in betwenn the minus 2 years from today and 4 years from today 

 

between 18/03/2001 and 18/03/1999 

 

the value i send to the querry is AGE  lets say 3 

 

May be i should be doing a now() - 2 and now()-4 as the between values..

 

HMMMMM is that more like it?????

any pointers will be most appresiated

 

[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

Hint: The cause of this error is usually that your query contains a reference to a field which does not exist. You should verify that the fields included in your query exist and that you have specified their names correctly.

SQL = "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 Talent.gender = 'male' AND dob BETWEEN DateAdd(Year,7,dob) AND DateAdd(Year,3,dob)"

 

<cfset Form.age =5>
<!--- set age diff --->
<cfset Form.OlderThan = Form.age + 2>
<cfoutput>#Form.OlderThan#</cfoutput>
<cfset Form.YoungerThan = Form.age - 2>
<cfoutput>#Form.youngerThan#</cfoutput>

 


<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

 


 <CFIF ParameterExists(url.ID)>
 WHERE  Talent.ID = #url.ID#
 </CFIF>


<!--- Check for gender --->
<CFIF ParameterExists(form.search)>
 WHERE  Talent.gender = '#form.gender#'

<!--- 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>

 

thanks

---
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/ ---
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/
______________________________________________________________________
This email, including attachments, is intended only for the addressee
and may be confidential, privileged and subject to copyright.  If you
have received this email in error, please advise the sender and delete
it.  If you are not the intended recipient of this email, you must not
use, copy or disclose its content to anyone.  You must not copy or 
communicate to others content that is confidential or subject to 
copyright, unless you have the consent of the content owner.

<<attachment: image001.jpg>>

Reply via email to