troubleshooting Question

CF - Display records based on other values

Avatar of JohnMac328
JohnMac328Flag for United States of America asked on
Web Development SoftwareColdFusion Language
131 Comments1 Solution1786 ViewsLast Modified:
The section I am working on is similar to the structure of the referring question.  The section lists the videos that the employees possibly have seen take a test on.  Currently I have all the videos listed no matter what employee is selected.  I was trying to get only the videos to show that they are allowed to test on which is that they have seen it, checked it in and has a test date of null.  Here is the query I am working with

SELECT     Employees.EmployeeID, Detail.VideoID, VideoList.Video_Name, VideoList.NumTests
FROM         Employees INNER JOIN
                      Detail ON Employees.EmployeeID = Detail.EmployeeID INNER JOIN
                      VideoList ON Detail.VideoID = VideoList.VideoID
WHERE Employees.EmployeeID = #val(form.EmployeeID)#

The problem is that WHERE Employees.EmployeeID = #val(form.EmployeeID)# is not diaplaying any videos at all no matter what employee is selected.

Any help is appreciated - I have also included the form
<table class="displayTable">
      <cfform action="AddTestDetails.cfm" method="post" format="html">
      <tr>
        <th>Employee</th>
        <th>Video</th>
        <th>Number of Tests</th>
        <th>Score</th>
     </tr>
      <tr>
        <td><select name="employeeID">
            <cfoutput query="getAllEmployees">
              <option value="#employeeID#">#First_Name##Last_Name#</option>
            </cfoutput>
        </select></td>
        <td width="30"><select name="VideoID" onChange="showNumTests(this.value)">
            <cfoutput query="getAllFilms">
              <option value="#VideoID#">#VideoID# - #Video_Name#</option>
           <cfinput type="hidden" name="employeeID">
			</cfoutput>
        </select></td>
       <td><cfinput type="text" id="NumTests" name="NumTests" size="5"></td>
       <td><cfinput type="text" name="Test_Score" size="5"></td>
      </tr>
      <tr>
        <th>Test Status</th>
        <th>Credits</th>
        <th>Test Date</th>
      </tr>
      <tr>
         <td><select id="status" select name="Test_Status" onChange="updateCredits(this, 'credits');">
            <option value='1'#UserPass#>Passed</option>
            <option value='0'#UserFail#>Fail</option>
        </select></td>
        <td><select id="credits" select name="Credits_Earned">
            <option value='0'>0</option>
            <option value='1'>1</option>
            </select></td> 
            <td><cfinput type="datefield" name="Test_Date"></td>
      </tr>
      <tr>
        <td><input type = "Submit" value = "Submit" name="Submit"></td>
      </tr>
      </cfform>
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 131 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 131 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros