Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
WolfShade_2k #1
Compare record field with another record field of samerecordset
:confused;
... but I don't know how to refer to field of next record in loop through recordset. Any ideas?
Thanks,
WolfShade
WolfShade_2k Guest
-
Displaying only a part of a record field
I would like to output only a part of a record field which is returned by a query. For example the outputed text would look like: "Drawing has... -
Retrieving a field from the NEW record
Hi all, I'm tearing my hair out trying to solve the following problem. I want to be able to retrieve the value of the primary key in a trigger... -
Fill a field from the previous record
I want to fill in one (1) text box with data from the previous record (same text box). I've used the code from:... -
Duplicate value appears on page for 1 field in 1 record
This is very very strange. I have an ASP page that reads records from a database and displays a list of them on the screen. For some reason the... -
updating a record on a form based on another field
Please help. I am trying to update a record in a form based on another field in that form. I have tried using the Me! and dlookup options I found... -
adonis1976 #2
Re: Compare record field with another record field ofsame recordset
say your myQuery returned a bunch of numbers...then you would loop through the
query results and do the comparison inside the loop as follows..
<cfloop query="myQuery" index="i">
<cfif myQuery EQ myQuery[i+1]>
Do this
</cfif>
</cfloop>
adonis1976 Guest
-
WolfShade_2k #3
Re: Compare record field with another record field ofsame recordset
Originally posted by: adonis1976
<cfloop query="myQuery" index="i">
<cfif myQuery EQ myQuery[i+1]>
Do this
</cfif>
</cfloop>
So I can refer to the position within the returned recordset simply by
bracketing the index after the query name?? Like so;
<cfset ths=0>
<cfloop query="get_all_answers" index="idx">
<cfif get_all_answers[idx] eq get_all_answers[idx+1]>
<cfset ths = ths+1>
</cfif>
</cfloop>
<cfif ths gt 0><cfoutput>There are #ths# duplicates in the query</cfoutput>
Like that?
WolfShade
^_^
WolfShade_2k Guest
-
adonis1976 #4
Re: Compare record field with another record field ofsame recordset
You are right.. your loop should work..
adonis1976 Guest



Reply With Quote

