Title: Message
check the code i sent you...
 
remove the <cfoutput> and <pre> tags you have nested within your <cfquery>:
 
it should look like this:

<cfquery name="getRecord" datasource="interact">
 SELECT  Talent.talentID , 
  Talent.Name ,
  Talent.Gender ,
  Talent.DOB ,
  Talent.Hair ,
  Talent.Eye ,
  Talent.Height ,
  Talent.Clothessize ,
  Talent.shoesize ,
  Talent.hobbies ,
  Talent.BIO ,
  Talent.Compcard ,
  Talent.ID
 FROM   Talent
 where (Talent.DOB <= {d '#Olderthan#'} and Talent.DOB >= {d '#Youngerthan#'})
</cfquery>

then use <cfoutput> to output the results of the query like this:
 
<cfoutput query="getRecord">
...fieldnames from query go in here...
 
</cfoutput>
 
hope this helps... steve
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, 20 March 2003 11:48 AM
To: CFAussie Mailing List
Subject: [cfaussie] RE: New look up date by years old with a 2 year spread < 2 > 2

Hi

I tired that one but still getting an error.
Dont know what to do any one with more pointers
 

<cfset Form.age =5>
<!--- set age diff --->
<cfset Older = Form.age + 2>
<cfset Younger = Form.age - 2>

<!--- create the dates --->
<cfoutput>
<cfset Olderthan = dateformat(DateAdd("yyyy", -Older, Now()),'yyyy-mm-dd')>
<cfset Youngerthan = dateformat(DateAdd("yyyy",-Younger,Now()),'yyyy-mm-dd')>
get all records where member was born between #Olderthan# and #Youngerthan#
</cfoutput>

<cfquery name="getRecord" datasource="interact">
 <cfoutput><pre>
 SELECT  Talent.talentID , 
  Talent.Name ,
  Talent.Gender ,
  Talent.DOB ,
  Talent.Hair ,
  Talent.Eye ,
  Talent.Height ,
  Talent.Clothessize ,
  Talent.shoesize ,
  Talent.hobbies ,
  Talent.BIO ,
  Talent.Compcard ,
  Talent.ID
 FROM   Talent
 where (Talent.DOB <= {d '#Olderthan#'} and Talent.DOB >= {d '#Youngerthan#'})
</pre></cfoutput>
</cfquery>

 

 

Error Diagnostic Information

ODBC Error Code = 37000 (Syntax error or access violation)

[Microsoft][ODBC Microsoft Access Driver] Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'.

SQL = "

	SELECT  Talent.talentID ,  
		Talent.Name , 
		Talent.Gender , 
		Talent.DOB , 
		Talent.Hair , 
		Talent.Eye , 
		Talent.Height , 
		Talent.Clothessize , 
		Talent.shoesize , 
		Talent.hobbies , 
		Talent.BIO , 
		Talent.Compcard , 
		Talent.ID
	FROM  	Talent
	where (Talent.DOB <= {d '1996-03-20'} and Talent.DOB >= {d '2000-03-20'})
"

Data Source = "INTERACT"

The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (16:1) to (16:48) in the template file C:\Documents and Settings\Greg Stone.GREG\My Documents\client coldfusion workfiles\interact\application\members\test.cfm.

Date/Time: 03/20/03 11:41:57
Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; MSOCD; YComp 5.0.2.4; .NET CLR 1.0.3705)
Remote Address: 127.0.0.1
HTTP Referer: http://127.0.0.1/mydocuments/client%20coldfusion%20workfiles/interact/application/members/test.cfm

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