To start, using
Instead of using "is "GW"" which
is not the most effecient try
If any field posted in the query
get is equal to GW it will do the
first set, otherwise it will
drop to the else set. Since you are
in a single loop you do not have
to use "get.posted".
<cfif not Compare(posted, "GW")>
set
<cfelse>
set
</cfif>
One other comment :)
doing <cfset txtoutput = '"#BillNo#"~"#NewQty#"'>
Is kind if bad because you are using single quotes
instead try escaping the double quotes
which is your intention? that is 'proper' syntax
below. And does the same thing you want, I have
ran into problems using the single quotes some
of the time so its a 'best practice' to avoid that.
<cfset txtoutput = """#BillNo#""~""#NewQty#""">
Jeremy Allen
[EMAIL PROTECTED]
Insert Quarter Here --->[]<---
-----Original Message-----
From: Adrian Cesana [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 28, 2000 1: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/[email protected]/
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/[email protected]/
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.