danarashad
Programmer
I need some help comparing data. What I am doing is looping through a table, and getting values. What I want to do is compare the values I receive against each other. Is this possible using coldfusion.
<cfquery name="statuscheck" datasource="#datasource#">
SELECT access.userid, access.buildingID, Questions.rec_id, Questions.UserId, Questions.status
FROM access INNER JOIN Questions ON access.sectionid = Questions.rec_id
where access.userid=#maintUserID# and questions.userid=#ID# and Questions.status=1;
</cfquery>
<cfif statuscheck.recordcount GT 1>
<cfoutput>#statuscheck.recordcount#</cfoutput>
<cfloop query="statuscheck">
<cfoutput>#buildingID# </cfoutput>
</cfloop>
</cfif>
It outputs the values, but what i want to do is compare the output, to one another.
<cfquery name="statuscheck" datasource="#datasource#">
SELECT access.userid, access.buildingID, Questions.rec_id, Questions.UserId, Questions.status
FROM access INNER JOIN Questions ON access.sectionid = Questions.rec_id
where access.userid=#maintUserID# and questions.userid=#ID# and Questions.status=1;
</cfquery>
<cfif statuscheck.recordcount GT 1>
<cfoutput>#statuscheck.recordcount#</cfoutput>
<cfloop query="statuscheck">
<cfoutput>#buildingID# </cfoutput>
</cfloop>
</cfif>
It outputs the values, but what i want to do is compare the output, to one another.