I need to figure this out fast! Have a meeting in a few hours....I am
trying to run an update query in a loop but it is not working. I have
defined and hard coded my one variable called 'skilloffset'. I need for my
query to update where
DisplayNum=X + #SkillOffset#
I'm not sure how to make that work...
I kept getting the msg that X can not be changed to a number. I played
around with it and now it is giving me the classic odbc error when a
variable isn't defined/misspelled....Does anyone have a clue???
Here's the code. I know it's clunky
Thanks to any/all who can help.
j
<CFPARAM NAME="SkillOffset" Default="0">
<CFIF CLIENT.CourseID IS 1 or CLIENT.CourseID IS 2>
<CFSET SkillOffset=0>
<CFELSEIF CLIENT.CourseID IS 3 or CLIENT.CourseID IS 4>
<CFSET SkillOffset=13>
<CFELSEIF CLIENT.CourseID IS 5 or CLIENT.CourseID IS 6>
<CFSET SkillOffset=25>
<CFELSEIF CLIENT.CourseID or CLIENT.CourseID IS 7>
<CFSET SkillOffset=39>
<CFELSEIF CLIENT.CourseID or CLIENT.CourseID IS 8>
<CFSET SkillOffset=47>
</CFIF>
<CFLOOP INDEX="X" FROM=1 TO="#ListLen(GradeforSubject)#">
<CFQUERY NAME="EditGrades" DATASOURCE="Edu">
UPDATE tbl_StudentGrade
SET GradeForSubject='#ListGetAt(GradeForSubject,X)#'
WHERE PERMNUM='#CLIENT.PERMNUM#' and CLIENT.DisplayNum=SkillOffset
</CFQUERY>
</CFLOOP>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists