2 Replies - 3590 Views - Last Post: 24 April 2012 - 11:29 PM Rate Topic: -----

#1 De.camm  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 05-March 12

How to make some comparison query to effect the field text output?

Posted 22 April 2012 - 07:02 PM

I tried to make query that did some comparison, but its didn't work,this is my 1st code:

<cfquery name="qStuOcourse" datasource="#Variables.fw.Config.DSN#">
  		SELECT * FROM View_Stu_Detail_Alumni
		WHERE student_code='#url.test#'
        <cfif course_code EQ "DTA">
        	THEN Form.couRse value = ""
        </cfif>
        <cfif course_code EQ "DBB">
        	THEN Form.couRse value = ""
        </cfif>
        <cfif course_code EQ "AUTOBODY">
        	THEN Form.couRse value = ""
        </cfif>
        <cfif course_code EQ "DDW">
        	THEN Form.couRse value = ""
        </cfif>
        <cfif course_code EQ "DDG">
        	THEN Form.couRse value = ""
        </cfif>
        <cfif course_code EQ "DDF">
        	THEN Form.couRse value = ""
        </cfif>
        <cfif course_code EQ "DDC">
        	THEN Form.couRse value = ""
        </cfif>
        <cfif course_code EQ "DMB">
        	THEN Form.couRse value = ""
        </cfif>
        <cfif course_code EQ "DKM">
        	THEN Form.couRse value = ""
        </cfif>
        <cfif course_code EQ "SJB">
        	THEN Form.couRse value = ""
        </cfif>
        <cfif course_code EQ "MKM">
        	THEN Form.couRse value = ""
        </cfif>
        <cfif course_code EQ "SJK">
        	THEN Form.couRse value = ""
        </cfif>
</cfquery>


in this situation, I tried to compare with some code which is (DTA,DBB,AUTOBODY,DDW,DDG,DDF,DDC,DMB,DKM,SJB,MKM,SJK), actually the code extract from table named "View_Stu_Detail_Alumni", and location at column "course_code". I tried to compare if the student_code calling and their course_code same as comparison list, the text field will be empty.
Unfortunately my code not running, anything wrong with my code? anybody please help me.

Is This A Good Question/Topic? 0
  • +

Replies To: How to make some comparison query to effect the field text output?

#2 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 1919
  • View blog
  • Posts: 3,461
  • Joined: 13-January 08

Re: How to make some comparison query to effect the field text output?

Posted 23 April 2012 - 05:56 AM

This is more of a SQL issue than it is a CF issue. You're used to IF/THEN convention but that's not really what's going on here. While THEN is a valid SQL word, it's not what you need in the example. Replace THEN with AND and you should be fine.
Was This Post Helpful? 0
  • +
  • -

#3 De.camm  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 05-March 12

Re: How to make some comparison query to effect the field text output?

Posted 24 April 2012 - 11:29 PM

View PostCraig328, on 23 April 2012 - 05:56 AM, said:

This is more of a SQL issue than it is a CF issue. You're used to IF/THEN convention but that's not really what's going on here. While THEN is a valid SQL word, it's not what you need in the example. Replace THEN with AND and you should be fine.


Thanks cRaig~ its okay now..
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1