Hello,
Is there a way in Access to dynamically build a table based on the records of another pre-existing table? Basically, are building a "course registration" app. We already have a table that houses all the records of the course information (i.e. Title, Start_Time, Stop_Time, Capacity, etc.). Now we want a second table where individual "students" register for courses based on what they want to take during a certain time-slot. The basic structure is simply a RefNum field followed by individual fields for each possible time slot. The possible time_slots change from semester to semester... so we want TABLE B to generate the time_slot fields automatically by looking up DISTINCT start_times in TABLE A.
This is running off ColdFusion and I've played around with the ALTER command to get some results...
That does indeed create new fieldnames based on the "Session" table, but I really need this funcionality in the database itself. In addition, it would be best if the "Schedule" db is updated automatically as new time_slots are added to the "Session" table... instead of having to run a query each time.
Any help would be appreciated.
Is there a way in Access to dynamically build a table based on the records of another pre-existing table? Basically, are building a "course registration" app. We already have a table that houses all the records of the course information (i.e. Title, Start_Time, Stop_Time, Capacity, etc.). Now we want a second table where individual "students" register for courses based on what they want to take during a certain time-slot. The basic structure is simply a RefNum field followed by individual fields for each possible time slot. The possible time_slots change from semester to semester... so we want TABLE B to generate the time_slot fields automatically by looking up DISTINCT start_times in TABLE A.
This is running off ColdFusion and I've played around with the ALTER command to get some results...
Code:
<CFQUERY NAME="GetTimes" DATASOURCE="#sourcename#">
SELECT DISTINCT(start_time) AS TimeSlot
FROM Sessions
</CFQUERY>
<CFOUTPUT QUERY="GetTimes">
<CFQUERY NAME="AlterTable" DATASOURCE="#sourcename#">
ALTER TABLE Schedule
ADD "#DateFormat(TimeSlot)# #TimeFormat(TimeSlot)#" dateTime
</CFQUERY>
Any help would be appreciated.