|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
No results with checkbox field in search
Everything is working when I search for the text or drop-down fields, except for the checkbox field. Here is my code:
SELECT * FROM ALUMNA WHERE 0=0 <cfif Len(Form.maj)>AND MAJOR='#Form.maj#'</cfif> <cfif IsDefined("Form.host") >AND WILLHOST='#Form.host#'</cfif> <cfif Len(Form.fname)>AND FIRSTNAME='#Form.fname#'</cfif> <cfif Len(Form.lname)>AND LASTNAME='#Form.lname#'</cfif> <cfif Len(Form.profession)>AND PROFESSION='#Form.Profession#'</cfif> <cfif Len(Form.state)>AND STATE='#Form.State#'</cfif> ************** When I try to check the checkbox and do a search the error message is: ODBC Error Code = 22005 (Error in assignment) [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression. SQL = "SELECT * FROM ALUMNA WHERE 0=0 AND WILLHOST=''" ***** In my form with the checkbox field, this is what I have: <cfinput name="host" type="checkbox" value="" required="no"> ************* Do you have any suggestions for this problem...thanks! |
|
#2
|
|||
|
|||
|
you need to set a value for the checkbox, is "willhost" a bit field, if so set the value to 1
e.g. <input type="checkbox" name="host" value="1"> |
|
#3
|
|||
|
|||
|
Quote:
No, it is not a bit value- in access, it is a yes/no value (yes if they can host someone, or yes if checked) So should the value by yes/no, or should something change in my sql statement? |
|
#4
|
|||
|
|||
|
value should be set to whatever is stored in the corresponding field, the stmt is fine, just change the value
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > No results with checkbox field in search |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|