|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Virtual Tradeshows by Ziff Davis Enterprise - A Unique Opportunity to Connect with IT Experts, Access Information, and Gain Insight on today's Technology
|
|
#1
|
|||
|
|||
|
i had wrote a query to compare two data from two database. but when compare cos there is spaces after one data in the database. i tried to use the trim function but error occured stated unrecognised s.stud_ans. anyone can help?
<cfquery name="calculate" datasource="#pppk#"> SELECT count(*) AS calc_ans from pEstudent_ans s INNER JOIN #table_name# o ON #Trim(s.stud_ans)#=o.sub_ans and s.stud_id= '#stud_id#' and s.entry_id ='#entry_id#' and o.ques_set ='#ques_set#' and s.ques_no= o.ques_no </cfquery> |
|
#2
|
|||
|
|||
|
Trim takes a string or a variable. When you do this:
#Trim(s.stud_ans)# CF thinks that you are trying to trim a variable called "s.stud_ans" which I'm guessing does not exist. You can try #trim( 's.stud_ans' )#, but clearly there are no spaces there to trim. Try trimming the variables that you ARE passing to the query, like #table_name#, #stud_id#, etc. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > trim function |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|