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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

To Darkman from Potinenip

Status
Not open for further replies.

potinenip

Programmer
Jul 12, 2000
35
US
DM,<br><br>This is what i included as suggested by you.<br>&lt;cfquery name=&quot;Homes&quot; datasource=&quot;db1&quot;&gt;<br>&nbsp;&nbsp;SELECT * from Property<br>&nbsp;&nbsp;WHERE PropBedrooms &gt;= #PropBedrooms# and<br>&nbsp;&nbsp;PropBathrooms &gt;= #PropBathrooms#<br>&nbsp;&nbsp;and PropState = '#PropState#'<br>&nbsp;&nbsp;and PropType = '#PropType#'<br>&nbsp;&nbsp;and PropPrice = '#MaxPrice#' <br>&lt;/cfquery&gt;<br><br>From the previous prblem i got. I got this new error.<br><br>ODBC Error Code = 22005 (Error in assignment)<br>[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.<br>The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (31:1) to (31:39).<br><br>
 
Check your datatypes in your Property table...&nbsp;&nbsp;The values that are numbers should not have single quotes, and all others should have them.&nbsp;&nbsp;My guess is your that your '#MaxPrice#' should be #MaxPrice# (no quotes) since it is probably a numerical value...&nbsp;&nbsp;Also, I would think that people inputting a price want to find something that price or lower, so you may want to consider making that portion of the statement<br><FONT FACE=monospace><br>and PropPrice &lt;= #MaxPrice#<br></font><br>This will let them find properties that are cheaper than the price they input...<br><br>Hope this helps.<br>DM
 
DM,<br>Thanks for the suggestion. It worked finally.<br>But i am not getting the previous and next button thing. i wrote code to diplay 5 records at a time. but all the records are displayed.<br>Can u look at my code suggest where i am wrong.<br><br><br>&lt;CFSET MaxRows=5&gt;<br>&lt;!--- Initialize all fields if they do not exist ---&gt;<br>&lt;CFPARAM NAME=&quot;start&quot; DEFAULT=&quot;1&quot;&gt;<br><br>&lt;!--- What are the previous and next row to start positions ---&gt;<br>&lt;CFSET PrevStart = Start - MaxRows&gt;<br>&lt;CFSET NextStart = Start + MaxRows&gt;<br><br>&lt;!--- Previous button code ---&gt;<br>&lt;TD COLSPAN=&quot;3&quot; ALIGN=&quot;LEFT&quot;&gt;<br>&lt;CFIF PrevStart GTE 1&gt;<br>&nbsp;&lt;CFOUTPUT&gt;<br>&nbsp;&lt;FORM ACTION=&quot;PostNewHome_searchAction.cfm&quot; METHOD=&quot;POST&quot;&gt;<br>&nbsp;&lt;INPUT TYPE=&quot;hidden&quot; NAME=&quot;start&quot; VALUE=&quot;#PrevStart#&quot;&gt;<br>&nbsp;&lt;INPUT TYPE=&quot;hidden&quot; NAME=&quot;PropState&quot; VALUE=&quot;#PropState#&quot;&gt;<br>&nbsp;&lt;INPUT TYPE=&quot;hidden&quot; NAME=&quot;PropType&quot; VALUE=&quot;#PropType#&quot;&gt;<br>&nbsp;&lt;INPUT TYPE=&quot;hidden&quot; NAME=&quot;PropPrice&quot; VALUE=&quot;#PropPrice#&quot;&gt;<br>&nbsp;&lt;INPUT TYPE=&quot;hidden&quot; NAME=&quot;PropBedrooms&quot; VALUE=&quot;#PropBedrooms#&quot;&gt;<br>&nbsp;&lt;INPUT TYPE=&quot;hidden&quot; NAME=&quot;PropBathrooms&quot; VALUE=&quot;#PropBathrooms#&quot;&gt;<br>&nbsp;&lt;INPUT TYPE=&quot;submit&quot; VALUE=&quot;Previous #MaxRows#&quot;&gt;<br>&nbsp;&lt;/FORM&gt;<br>&nbsp;&lt;/CFOUTPUT&gt;<br>&lt;/CFIF&gt;<br>&lt;/TD&gt;<br><br><br>&lt;TD COLSPAN=&quot;3&quot; ALIGN=&quot;RIGHT&quot;&gt;<br>&lt;!--- Next button code ---&gt;<br>&lt;CFIF NextStart LTE GetHouse.RecordCount&gt;<br>&nbsp;&lt;CFOUTPUT&gt;<br>&nbsp;&lt;FORM ACTION=&quot;PostNewHome_SearchAction.cfm&quot; METHOD=&quot;POST&quot;&gt;<br>&nbsp;&lt;INPUT TYPE=&quot;hidden&quot; NAME=&quot;start&quot; VALUE=&quot;#NextStart#&quot;&gt;<br>&nbsp;&lt;INPUT TYPE=&quot;hidden&quot; NAME=&quot;PropState&quot; VALUE=&quot;#PropState#&quot;&gt;<br>&nbsp;&lt;INPUT TYPE=&quot;hidden&quot; NAME=&quot;PropType&quot; VALUE=&quot;#PropType#&quot;&gt;<br>&nbsp;&lt;INPUT TYPE=&quot;hidden&quot; NAME=&quot;PropPrice&quot; VALUE=&quot;#PropPrice#&quot;&gt;<br>&nbsp;&lt;INPUT TYPE=&quot;hidden&quot; NAME=&quot;PropBedrooms&quot; VALUE=&quot;#PropBedrooms#&quot;&gt;<br>&nbsp;&lt;INPUT TYPE=&quot;hidden&quot; NAME=&quot;PropBathrooms&quot; VALUE=&quot;#PropBathrooms#&quot;&gt;<br>&nbsp;&lt;INPUT TYPE=&quot;submit&quot; VALUE=&quot;Next #MaxRows#&quot;&gt;<br>&nbsp;&lt;/FORM&gt;<br>&nbsp;&lt;/CFOUTPUT&gt;<br>
 
Your button code looks okay.. When you're outputting your data, though, do you have a startrow and maxrows in your CFOUTPUT tag?
 
DM,<br>That suggestion worked. Infact i wrote that before but then deleted to deal with another error and then forgot to put that.<br>Thanks again for ur suggestions.
 
DM,<br>Sorry for pestering you. I'm new to Development in Coldfusion and i'm learning from u.<br>Need one more suggestion. How do we create the list of records. Instead of next button, an we put numbers <br>1 2 3...&nbsp;&nbsp;as links which will diplay the records accordingly.<br>Praveen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top