|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Is it possible to compare the currentrow of the cfquery output to the currentrow-1 of the cfquery output?
something like <cfif getResults.BreakTime = getResults.BreakTime[i-1]> <cfelse>#getResults.BreakTime#</cfif> of course this one throws an error pointing to '=' |
|
#2
|
|||
|
|||
|
how about
<cfif myQuery.myColumn[currentRow] eq myQuery.myColumn[currentRow - 1]>
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#3
|
|||
|
|||
|
yup, thanks.
i put = instead of EQ ... |
|
#4
|
||||
|
||||
|
You'll have to store getResults.BreakTime in a variable and then compare it each time.
Before the loop: <cfset breakStore = ""> In the loop: <cfif breakStore NEQ getResults.BreakTime> DO SOMETHING <cfset breakStore = getResults.BreakTime> </cfif> This is the easiest method I know of to do this sort of thing because CF has no equivalent to PHP's fetch_row functions. Hope that helps. |
|
#5
|
|||
|
|||
|
i wish cf had some fetch_row type of functions. that would be really nice...
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > comparing fetched results |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|