[thelist] ColdFusion Question

Jonathan Lim jonathan.lim at netdecisions.co.uk
Tue Sep 26 06:36:13 CDT 2000

Can't see any error. Just a thought though, name your query and variables
differently. Since you haven't scoped ClassName in your second query, CF may
be getting confused.

Try this:
<!--- Select class name and description --->
<cfquery datasource="blah" name="ClassName">
	SELECT c.ID, c.TableName, c.CourseName, sd.StudentID, sd.LastName,
	FROM   Classes c, StudentData sd
	c.TableName = sd.TableName
	c.TableName = '#ClassName#'
	ORDER BY sd.LastName	

I don't know your schema, but this assumes that the class name is stored in
the TableName field on both your tables.


-----Original Message-----
From: Minh Lee Goon [mailto:v7ac at sdsumus.sdstate.edu]
Sent: 25 September 2000 21:53
To: evolt
Subject: [thelist] ColdFusion Question

Dear evolters,
I really need your help here. You can view what I have at

I have a database of student information and some of the columns have
been given names like Access2000 and Excel2000 to denote the training
classes for which they have signed up. In those columns are the dates of
the classes. The names of those columns are also names of separate
tables (which may be my downfall), in which are stored the dates of that
class. For example, the Access2000 table would contain the dates and
times of Access 2000 classes.

Now, I've got the registration form pretty much done. I'm working on the
administration area to give our training coordinator access to print off
attendance sheets, ie the names of the people who have signed up for
each class.

Here's what I have:
<cfset ClassName="#url.Class#">

<!--- Select class name and description --->
<cfquery datasource="blah" name="ClassName">
	SELECT ID, TableName, CourseName
	FROM   Classes
	WHERE  TableName = '#ClassName#'

<!--- Select list of student in that class --->
<cfquery datasource="blah" name="StudentsList">
	SELECT   StudentID, LastName, FirstName, #ClassName#
	FROM     StudentData
	ORDER BY LastName

I'm stuck here. Any suggestions at all?

Thanks in advance.


For unsubscribe and other options, including
the Tip Harvester and archive of TheList go to:
http://lists.evolt.org Workers of the Web, evolt ! 

More information about the thelist mailing list