It should work.  Are you sure about the data? If your datatype is CHAR(5),
for example, the actual stored value would be "GW   ", not "GW".

How about RTRIM(posted) IS "GW"?

-----Original Message-----
From: Adrian Cesana [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 28, 2000 12:48 PM
To: CF-Talk
Subject: cfloop headache


What am I doing wrong here...I am trying to evaluate a field and change the
outoput based on this.  I know I have a few records that meet the <cfif
get.posted IS "GW"> test but they dont get SET to 0 as if the test failed.
It appears I am not evaluating on the correct record.  Do I need to set a
field from the query to a list then loop thru the list perhaps?  Seems like
I should be able to do it like this somehow...

Thanks,Adrian


Ive slimmed the query and output down to make it simple:


<CFQUERY NAME="get" DATASOURCE="blah">
SELECT billno,posted,qty FROM blah WHERE blah
</CFQUERY>

<cfloop query="get">

<cfif posted IS "GW">   <!--- tried get.posted - same result --->
<cfset NewQty = 0>
<cfelse>
<cfset NewQty = qty>
</cfif>

<cfset txtoutput = '"#BillNo#"~"#NewQty#"'>
<cffile action=append file="blah" output="#txtoutput#">

</cfloop>





----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to