Hi Guys
Can anyone help me with my sql statement?
I have two tables Employees and Centre. I need to show on page LastName, FirstName, CentreName, JobTitle from Employees table and TelNo from Centre table.
TelNo is Tel No of Centre. CentreName is from Employees table and is a foreign key. I have CentreName in Centre table as a primary key. This is what links the two tables. I tried creating the SQL in Access as a query. When i imported it into my asp page this still didn't work.
The SQL statement is:
SQL="SELECT Employees.LastName, Employees.FirstName, Employees.CentreName, Employees.JobTitle, Centre.TelNo FROM Centre INNER JOIN Employees ON Centre.CentreName = Employees.CentreName"
To call the records:
<%
Do Until RS.EOF 'keep going until the end
%>
<tr valign="top">
<td class="dataContent"> <%=RS("LastName"
%></td>
<td class="dataContent"> <%=RS("FirstName"
%></td>
<td class="dataContent"> <%=RS("CentreName"
%></td>
<td class="dataContent"> <%=RS("JobTitle"
%></td>
<td class="dataContent"> <%RS("TelNo"
%></td>
</tr>
<%
RS.MoveNext
Loop
%>
The error message on asp page is:
Wrong number of arguments or invalid property assignment
/intranet_project/cafespirit/contacts/user_employee/user_listAll_employee.asp, line 139
Line 139 is:
<td class="dataContent"> <%RS("TelNo"
%></td>
Any help would be gratefully recieved.
Cheers.
Can anyone help me with my sql statement?
I have two tables Employees and Centre. I need to show on page LastName, FirstName, CentreName, JobTitle from Employees table and TelNo from Centre table.
TelNo is Tel No of Centre. CentreName is from Employees table and is a foreign key. I have CentreName in Centre table as a primary key. This is what links the two tables. I tried creating the SQL in Access as a query. When i imported it into my asp page this still didn't work.
The SQL statement is:
SQL="SELECT Employees.LastName, Employees.FirstName, Employees.CentreName, Employees.JobTitle, Centre.TelNo FROM Centre INNER JOIN Employees ON Centre.CentreName = Employees.CentreName"
To call the records:
<%
Do Until RS.EOF 'keep going until the end
%>
<tr valign="top">
<td class="dataContent"> <%=RS("LastName"
<td class="dataContent"> <%=RS("FirstName"
<td class="dataContent"> <%=RS("CentreName"
<td class="dataContent"> <%=RS("JobTitle"
<td class="dataContent"> <%RS("TelNo"
</tr>
<%
RS.MoveNext
Loop
%>
The error message on asp page is:
Wrong number of arguments or invalid property assignment
/intranet_project/cafespirit/contacts/user_employee/user_listAll_employee.asp, line 139
Line 139 is:
<td class="dataContent"> <%RS("TelNo"
Any help would be gratefully recieved.
Cheers.