Ooops It doesn't work..it does in Studio but when I run it off another
machine/browser I get the error msg again. Why would it work ok in studio
but not in the actual browser?
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 05, 2001 1:25 PM
To: CF-Talk
Subject: RE: Updates and loops and lists-Need help immediately.
Two things jump out at me... your last two CFELSEIF's have
CLIENT.CourseID OR CLIENT.CourseID IS (whatever)
This will evaluate to true if Client.CourseID <> 0, so you need to remove
the first client.courseid in those two.
Secondly, your where clause for your query:
where permnum = '#client.permnum#' AND client.displayNum = #Evaluate(x +
Skilloffset)#
Note the update there... and what kind of field is permnum? Number? Then
it should be permnum = #client.permnum#.
HTH
Hatton
> 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>
<CFQUERY NAME="EditGrades" DATASOURCE="Edu">
UPDATE tbl_StudentGrade
SET GradeForSubject='#ListGetAt(GradeForSubject,X)#'
WHERE PERMNUM='#CLIENT.PERMNUM#' and CLIENT.DisplayNum= SkillOffset
</CFQUERY>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists