Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFOUTPUT problem

Status
Not open for further replies.

theevilone

IS-IT--Management
Aug 19, 2001
52
GB
Hi,

I hope this makes sense.
I am writing a page which outputs all properties which falls between two rental values. The URL of the page would be view.cfm?rent1=100&rent2=400

I also have code in there which restricts the number of results to 10 per page.

<cfparam name=&quot;page&quot; default=&quot;1&quot;>
<cfparam name=&quot;items_per_page&quot; default=&quot;10&quot;>

<cfquery name=&quot;listproperty&quot; cachedwithin=&quot;#createTimeSpan(0,0,10,0)#&quot;>


select * from db

where rent gte #rent1# and rent lte #rent2#


</cfquery>
<cfset startrow = 1+(int(page-1)*int(items_per_page))>
<cfset total_pages = Ceiling(listproperty.Recordcount / items_per_page)>

I am getting a syntax error with the select statement. Any help will be appreciated.

Thanks in advance,
Ravi
 
you are using a CF statement in the where clause (gte and lte) these should be >= and <= respectively

your where statement will look like this:

where rent>=#rent1# and rent<=#rent2#

good luck

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top