RE: HELP!! Query - Loop - List - Form Madness
I do not get the gist of what you are trying to do (while skimming from my office while I should be working), but one pointer: You do not need to loop over a query to get a list of ids. Use the ValueList() method. It takes a column: cfset lstProposalIDs = ValueList(getproposals.proposalid) / Good luck. ... Ben Nadel Web Developer Nylon Technology 6 West 14th Street New York, NY 10011 212.691.1134 212.691.3477 fax www.nylontechnology.com Vote for Pedro ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225580 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: HELP!! Query - Loop - List - Form Madness
Molly, Hi, there. I think that using a database alias will do the trick. If you use this syntax: CFQUERY name=getindiv datasource=sotl SELECT #i# AS ProposalName FROMgrades06 WHERE readerid = #session.readerid# /CFQUERY then you can refer to that column as getindiv.ProposalName. Also, I noticed along the way something I would clean up a bit. You can replace all of this code: cfset proposals = '' cfoutput query=getproposals cfset proposals = '#listappend(proposals,proposalid)#' /cfoutput with this: CFSET proposals=#ValueList(getproposals.proposalid)# Hope this helps, Matthieu ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225587 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: HELP!! Query - Loop - List - Form Madness
It does and it doesn't. . .cannot figure out why. . . it seems to work. . but only returns the column name: cfquery name=getindiv datasource=sotl select #i# as grade from grades06 where readerid = #session.readerid# /cfquery tdcfoutput#getindiv.grade#/cfoutput (the column name -- ex: 404) is returned. . .not the value of '2' it contains. Debugging: getindiv (Datasource=sotl, Time=0ms, Records=1) in D:\Webpub\Wwwroot\ @ 12:18:47.047 select 404 as grade from grades06 where readerid = 2 Any more ideas?? Hugely grateful, but still apparently terminally slow. . . Molly, Hi, there. I think that using a database alias will do the trick. If you use this syntax: CFQUERY name=getindiv datasource=sotl SELECT #i# AS ProposalName FROMgrades06 WHERE readerid = #session.readerid# /CFQUERY ...then you can refer to that column as getindiv.ProposalName. Also, I noticed along the way something I would clean up a bit. You can replace all of this code: cfset proposals = '' cfoutput query=getproposals cfset proposals = '#listappend(proposals,proposalid)#' /cfoutput ...with this: CFSET proposals=#ValueList(getproposals.proposalid)# Hope this helps, Matthieu ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225596 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: HELP!! Query - Loop - List - Form Madness
Molly, cfquery name=getproposals datasource=sotl select * from proposal06 where readinggroup = #session.group# and status = 1 order by proposalid asc /cfquery cfset proposals = '' cfoutput query=getproposals cfset proposals = '#listappend(proposals,proposalid)#' /cfoutput This loop here, can be replaced with cfset proposals = ValueList(getProposals.ProposalID) cfloop list=#proposals# index=i cfquery name=getgrades datasource=sotl select #i# from grades06 where readerid = #session.readerid# /cfquery cfloop list=#getgrades.columnlist# index=i You've got a bit of a problem here. Your outer loop for the list of proposals uses a variable i for the current ProposalID in the list called Proposals. Your inner loop for the columns gained from the getGrades query also uses i in its loop. This will overwrite the contents of i when you hit the inner loop, plus its also making your code difficult to read. Call your index variables something a little bit more meaningful, for instance in the outer loop replace i with thisProposalID and in the inner loop, thisGradeColumnName. It should also be noted that you will only get one column in the getGrades query. That column will be the same name as the contents of i in the list of proposal IDs and your getIndiv query will therefore be identical to that of the getGrades query. I hate to say it, but I don't think any of your code after the getProposal query is working the way you intend it to. What are the columns in both proposal06 and grade06 and can you give us an example of the data you seen in these tables for one proposal? I'm inclinded to think that you need a JOIN of some kind in your SQL between the proposal and grade tables eg. SELECT {columnlist} FROM proposal06 AS P LEFT JOIN grades06 AS G ON P.ProposalID = G.ProposalID WHERE P.readinggroup = #session.group# AND P.status = 1 AND G.readerID = #session.readerid# ORDER BY P.ProposalID where {columnlist} is the columns you need to display from the two tables. You would then output the proposals and grades something like this : cfoutput query=ProposalGrades #ProposalGrades.ProposalTitle# - select name=#ProposalGrades.ProposalID# option value=1 #IIF(ProposalGrades.Grade EQ 1,DE('selected'),DE(''))#Accepted/option option value=0 #IIF(ProposalGrades.Grade EQ 0,DE('selected'),DE(''))#Reject/option option value=2 #IIF(ProposalGrades.Grade EQ 2,DE('selected'),DE(''))#Maybe/option option value=3 #IIF(ProposalGrades.Grade EQ OR ProposalGrades.Grade EQ 3,DE('selected'),DE(''))#Not Yet Graded/option /select /cfoutput Its not an ideal solution, but its probably more towards where you need to be. Hope that helps Regards Stephen ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225601 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: HELP!! Query - Loop - List - Form Madness
What database are you using? You need to name those columns differently. In MySQL, even if you do a straight select on a column named 404, it's going to return 404 for every row. However, if you name that column col_404, it'll return the values you're looking for. I think you've got a larger architectural problem here though. Why do you have these dynamic column names in the first place? This can all be represented much better in the database. You'd have a far easier time with your app and it'd work more efficiently if you reworked your db design to eliminate this nastiness. You're using a relational database for a reason -- so you can maintain the relationships between your data. You need to be taking advantage of that with joined tables rather than faking the funk with dynamically named columns in a table. --Ferg Molly Abraham wrote: It does and it doesn't. . .cannot figure out why. . . it seems to work. . but only returns the column name: cfquery name=getindiv datasource=sotl select #i# as grade from grades06 where readerid = #session.readerid# /cfquery tdcfoutput#getindiv.grade#/cfoutput (the column name -- ex: 404) is returned. . .not the value of '2' it contains. Debugging: getindiv (Datasource=sotl, Time=0ms, Records=1) in D:\Webpub\Wwwroot\ @ 12:18:47.047 select 404 as grade from grades06 where readerid = 2 Any more ideas?? Hugely grateful, but still apparently terminally slow. . . ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225607 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: HELP!! Query - Loop - List - Form Madness
All incredibly valid points! Unfortunately very short on time. . .they (faculty) need to start grading these things tomorrow evening. Starting closer to the beginning we currently have the following: 1) oracle database 2) one table containing the proposals -- proposalid, readinggroup, proposal details, status (saved - submitted) 3) one table containing reader info -- readerid, login, password, readinggroup What we need: 1)One table designed to hold all grades, for either group -- either together or separately 2) A form that can contain the correct information regarding the grades currently in the grades table for a given reader in a given reading group. Pathetic, isn't it? :-( I know its sad, but I want to learn how to fix this! THANK YOU! m On 11/29/05, Ken Ferguson [EMAIL PROTECTED] wrote: What database are you using? You need to name those columns differently. In MySQL, even if you do a straight select on a column named 404, it's going to return 404 for every row. However, if you name that column col_404, it'll return the values you're looking for. I think you've got a larger architectural problem here though. Why do you have these dynamic column names in the first place? This can all be represented much better in the database. You'd have a far easier time with your app and it'd work more efficiently if you reworked your db design to eliminate this nastiness. You're using a relational database for a reason -- so you can maintain the relationships between your data. You need to be taking advantage of that with joined tables rather than faking the funk with dynamically named columns in a table. --Ferg Molly Abraham wrote: It does and it doesn't. . .cannot figure out why. . . it seems to work. . but only returns the column name: cfquery name=getindiv datasource=sotl select #i# as grade from grades06 where readerid = #session.readerid# /cfquery tdcfoutput#getindiv.grade#/cfoutput (the column name -- ex: 404) is returned. . .not the value of '2' it contains. Debugging: getindiv (Datasource=sotl, Time=0ms, Records=1) in D:\Webpub\Wwwroot\ @ 12:18:47.047 select 404 as grade from grades06 where readerid = 2 Any more ideas?? Hugely grateful, but still apparently terminally slow. . . ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225610 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: HELP!! Query - Loop - List - Form Madness
I'm interested to know what happens in SQL+ or Toad if you run: select 404 from proposals I mean, am I understanding you right that you have a column in a database named 404 (or some other number)??? I would expect, given 5 results from the above query, that you would get: | --| | | 1 | 404 | | 2 | 404 | | 3 | 404 | | 4 | 404 | | 5 | 404 | | --| | no matter what the values in that column actually ARE. --Ferg M wrote: All incredibly valid points! Unfortunately very short on time. . .they (faculty) need to start grading these things tomorrow evening. Starting closer to the beginning we currently have the following: 1) oracle database 2) one table containing the proposals -- proposalid, readinggroup, proposal details, status (saved - submitted) 3) one table containing reader info -- readerid, login, password, readinggroup What we need: 1)One table designed to hold all grades, for either group -- either together or separately 2) A form that can contain the correct information regarding the grades currently in the grades table for a given reader in a given reading group. Pathetic, isn't it? :-( I know its sad, but I want to learn how to fix this! THANK YOU! m On 11/29/05, Ken Ferguson [EMAIL PROTECTED] wrote: What database are you using? You need to name those columns differently. In MySQL, even if you do a straight select on a column named 404, it's going to return 404 for every row. However, if you name that column col_404, it'll return the values you're looking for. I think you've got a larger architectural problem here though. Why do you have these dynamic column names in the first place? This can all be represented much better in the database. You'd have a far easier time with your app and it'd work more efficiently if you reworked your db design to eliminate this nastiness. You're using a relational database for a reason -- so you can maintain the relationships between your data. You need to be taking advantage of that with joined tables rather than faking the funk with dynamically named columns in a table. --Ferg Molly Abraham wrote: It does and it doesn't. . .cannot figure out why. . . it seems to work. . but only returns the column name: cfquery name=getindiv datasource=sotl select #i# as grade from grades06 where readerid = #session.readerid# /cfquery tdcfoutput#getindiv.grade#/cfoutput (the column name -- ex: 404) is returned. . .not the value of '2' it contains. Debugging: getindiv (Datasource=sotl, Time=0ms, Records=1) in D:\Webpub\Wwwroot\ @ 12:18:47.047 select 404 as grade from grades06 where readerid = 2 Any more ideas?? Hugely grateful, but still apparently terminally slow. . . ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225633 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: HELP!! Query - Loop - List - Form Madness
Ken, I ran this query on a table called USERS through Toad to an Oracle database: SELECT 404 FROM USERS and I got exactly what you described as a result: one column (named 404) with one row per row in USERS, each row equal to 404. I have contacted Molly off-list and am helping her with the db structure. It looks like she will be going with the restructuring/join approach advocated by the list. Matthieu -Original Message- From: Ken Ferguson [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 29, 2005 4:44 PM To: CF-Talk Subject: Re: HELP!! Query - Loop - List - Form Madness I'm interested to know what happens in SQL+ or Toad if you run: select 404 from proposals I mean, am I understanding you right that you have a column in a database named 404 (or some other number)??? I would expect, given 5 results from the above query, that you would get: | --| | | 1 | 404 | | 2 | 404 | | 3 | 404 | | 4 | 404 | | 5 | 404 | | --| | no matter what the values in that column actually ARE. --Ferg M wrote: All incredibly valid points! Unfortunately very short on time. . .they (faculty) need to start grading these things tomorrow evening. Starting closer to the beginning we currently have the following: 1) oracle database 2) one table containing the proposals -- proposalid, readinggroup, proposal details, status (saved - submitted) 3) one table containing reader info -- readerid, login, password, readinggroup What we need: 1)One table designed to hold all grades, for either group -- either together or separately 2) A form that can contain the correct information regarding the grades currently in the grades table for a given reader in a given reading group. Pathetic, isn't it? :-( I know its sad, but I want to learn how to fix this! THANK YOU! m On 11/29/05, Ken Ferguson [EMAIL PROTECTED] wrote: What database are you using? You need to name those columns differently. In MySQL, even if you do a straight select on a column named 404, it's going to return 404 for every row. However, if you name that column col_404, it'll return the values you're looking for. I think you've got a larger architectural problem here though. Why do you have these dynamic column names in the first place? This can all be represented much better in the database. You'd have a far easier time with your app and it'd work more efficiently if you reworked your db design to eliminate this nastiness. You're using a relational database for a reason -- so you can maintain the relationships between your data. You need to be taking advantage of that with joined tables rather than faking the funk with dynamically named columns in a table. --Ferg Molly Abraham wrote: It does and it doesn't. . .cannot figure out why. . . it seems to work. . but only returns the column name: cfquery name=getindiv datasource=sotl select #i# as grade from grades06 where readerid = #session.readerid# /cfquery tdcfoutput#getindiv.grade#/cfoutput (the column name -- ex: 404) is returned. . .not the value of '2' it contains. Debugging: getindiv (Datasource=sotl, Time=0ms, Records=1) in D:\Webpub\Wwwroot\ @ 12:18:47.047 select 404 as grade from grades06 where readerid = 2 Any more ideas?? Hugely grateful, but still apparently terminally slow. . . ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225634 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: HELP!! Query - Loop - List - Form Madness
I am confused. Down in your code, you have cfif #FIELD# is 1. Where should FIELD be coming from? Your getindiv query? Another of your queries? The form that from the previous page? -Original Message- From: Molly Abraham [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 29, 2005 9:13 AM To: CF-Talk Subject: HELP!! Query - Loop - List - Form Madness Hi. . . hope someone can help. . . (PLEASE BEAR WITH ME -- THIS IS ALL HIGGLEDYPIGGLEDY) we are having a problem displaying the value of a query variable. . it seems really confusing, and it is - but unfortunately this is the simplest way we can think of to do this. Our goal is to run a query to check and see what proposals (proposalid) have been submitted, create a table with column for each proposalid that also contains one row for each of the seven proposal 'readers'. (this part works) The readers then grade the proposals using an online form. Explanation of what we are doing is below. . . . BUT HERE IS THE PROBLEM WE ARE HAVING -- the 'readers' are able to log in repeatedly to input their 'grades', change them etc. . . which means we have to be able to capture the value stored in a given field. . . ex: cfquery name datasource select proposalcolumn from grades where reader = currentreader/cfquery The problem is that we do not know the name of the column!! and for the life of us we cannot figure out what variable to set, etc. . which would let us output this value!! Each reader reads only ~half of the proposals, as they are divided up by region. So, once the reader logs into the reader 'grading' section -- we create a session variable to denote which region they are from. On the 'grading' form page we then use the session variable to get only the columns for the grading table that correspond to the proposals they were assigned to read. ON THE GRADING FORM PAGE WE DO THIS TO GET THE DATA NEEDED TO CREATE THE FORM. cfquery name=getproposals datasource=sotl select * from proposal06 where readinggroup = #session.group# and status = 1 order by proposalid asc /cfquery cfset proposals = '' cfoutput query=getproposals cfset proposals = '#listappend(proposals,proposalid)#' /cfoutput THEN WE LOOP THE PROPOSALS LIST TO QUERY THE GRADES TABLE (PROPOSALID = GRADES.COLUMNNAME) cfloop list=#proposals# index=i cfquery name=getgrades datasource=sotl select #i# from grades06 where readerid = #session.readerid# /cfquery THEN WE LOOP THE GETGRADES QUERY TO POPULATE THE GRADING FORM WITH THE APPROPRIATE PROPOSAL FORM FIELDS cfloop list=#getgrades.columnlist# index=i tr cfoutput tdstrong#i#/strong/td THEN WE RUN THIS QUERY TO GET THE VALUE OF THE SPECIFIC FIELD (PREVIOUSLY SUBMITTED GRADE STORED IN THE TABLE !---get the grade for this proposal - based on column name from looping columnlist --- cfquery name=getindiv datasource=sotl select #i# from grades06 where readerid = #session.readerid# /cfquery tdAccept: !--- Should checkbox be pre-checked? --- !AND FINALLY -- IF YOU WADED THROUGH ALL OF THIS -- HERE IS THE PROBLEM -- HOW CAN WE REFERENCE THIS FIELD -- EVEN THOUGH WE DON'T KNOW THE FIELD NAME -- WE HAVE TRIED EVERYTHING WE CAN THINK OF (admittedly/obviously not that much) AND CAN'T GET IT TO WORK!!! cfif #FIELD# is 1 CFSET IsChecked = 'Yes' cfelse CFSET IsChecked = 'No' /cfif !--- Checkbox itself --- cfinput type=radio name=#i# checked=#IsChecked# value=1/td tdReject: !--- Should checkbox be pre-checked? --- cfif '#column#' eq 0 CFSET IsChecked = 'Yes' cfelse CFSET IsChecked = 'No' /cfif !--- Checkbox itself --- CFINPUT TYPE=radio NAME=#i# checked=#IsChecked# VALUE=0/td tdMaybe: !--- Should checkbox be pre-checked? --- cfif '#column#' eq '' CFSET IsChecked = 'Yes' cfelse CFSET IsChecked = 'No' /cfif !--- Checkbox itself --- CFINPUT TYPE=radio NAME=#i# checked=#IsChecked# VALUE=2 /td tdNot Yet Graded: !--- Should checkbox be pre-checked? --- cfif '#column#' eq '' CFSET IsChecked = 'Yes' cfelse CFSET IsChecked = 'No' /cfif !--- Checkbox itself --- CFINPUT TYPE=radio NAME=#i# checked=#IsChecked# VALUE=3 /td/cfoutput /tr /cfloop/cfloop tr Please take pity on us if you can! If you can make sense of this. Thank you. M ~| Find out how CFTicket can increase your company's customer support efficiency by 100%
Re: HELP!! Query - Loop - List - Form Madness
Okay. . . . just thought I'd jump in here. . . Matthieu is correct. . . I am in the middle of trying to build bigger and better data structures to handle what is admittedly a fairly simple task . . .but had dug myself so far into a hole trying to set it up the wrong way there is NO WAY I could have fixed it without all your help. . . . . But, just a note (found a generous oracle dba): if you query: cfquery name=getgrades datasource=sotl select '#proposal#' from grades06 where readerid = #session.readerid# /cfquery (putting the list variable in single quotes as the requested column name) You will get the value of the column!! and not just value of the list variable! On 11/29/05, Ken Ferguson [EMAIL PROTECTED] wrote: I'm interested to know what happens in SQL+ or Toad if you run: select 404 from proposals I mean, am I understanding you right that you have a column in a database named 404 (or some other number)??? I would expect, given 5 results from the above query, that you would get: | --| | | 1 | 404 | | 2 | 404 | | 3 | 404 | | 4 | 404 | | 5 | 404 | | --| | no matter what the values in that column actually ARE. --Ferg M wrote: All incredibly valid points! Unfortunately very short on time. . .they (faculty) need to start grading these things tomorrow evening. Starting closer to the beginning we currently have the following: 1) oracle database 2) one table containing the proposals -- proposalid, readinggroup, proposal details, status (saved - submitted) 3) one table containing reader info -- readerid, login, password, readinggroup What we need: 1)One table designed to hold all grades, for either group -- either together or separately 2) A form that can contain the correct information regarding the grades currently in the grades table for a given reader in a given reading group. Pathetic, isn't it? :-( I know its sad, but I want to learn how to fix this! THANK YOU! m On 11/29/05, Ken Ferguson [EMAIL PROTECTED] wrote: What database are you using? You need to name those columns differently. In MySQL, even if you do a straight select on a column named 404, it's going to return 404 for every row. However, if you name that column col_404, it'll return the values you're looking for. I think you've got a larger architectural problem here though. Why do you have these dynamic column names in the first place? This can all be represented much better in the database. You'd have a far easier time with your app and it'd work more efficiently if you reworked your db design to eliminate this nastiness. You're using a relational database for a reason -- so you can maintain the relationships between your data. You need to be taking advantage of that with joined tables rather than faking the funk with dynamically named columns in a table. --Ferg Molly Abraham wrote: It does and it doesn't. . .cannot figure out why. . . it seems to work. . but only returns the column name: cfquery name=getindiv datasource=sotl select #i# as grade from grades06 where readerid = #session.readerid# /cfquery tdcfoutput#getindiv.grade#/cfoutput (the column name -- ex: 404) is returned. . .not the value of '2' it contains. Debugging: getindiv (Datasource=sotl, Time=0ms, Records=1) in D:\Webpub\Wwwroot\ @ 12:18:47.047 select 404 as grade from grades06 where readerid = 2 Any more ideas?? Hugely grateful, but still apparently terminally slow. . . ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225645 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54