Link to home
Create AccountLog in
Avatar of erikTsomik
erikTsomikFlag for United States of America

asked on

coldfsuion get the data from the query

I an using coldfsuion cfscript . I have the query that return 20 records and i loop through that query to set the value conditionally and it does not wrok.

<cffunction name="SendTaskMessage" access="public" returntype="any" output="false">
            
var qry = query
            <cfscript>
                      for(var d = 1;d lte qry.recordcount;d++){
if (qry["repeatPeriod"][d] == 0){
                                          var locTask = 0;
                                          
                                    }else{
                                          var locTask = 1;
                                          
                                    }
}

                 </cfscript>
</cffunction >
Avatar of erikTsomik
erikTsomik
Flag of United States of America image

ASKER

does anybody knows why?
ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
the repeatPeriod is either 0 or 1
(Edit) You didn't answer the earlier question. The example above demonstrates it works as *I'd* expect, so the problem you're having isn't clear.

         "... you need to elaborate on "does not wrok"?  What is the code doing
         wrong OR not doing? "