Am fixing bugs in an old classic ASP site written by another developer who has since stopped working. The following SQL command is used to call data from the database to create a table:
SELECT *
FROM tblPropertyInfo
INNER JOIN tblUsers on p_CustomerID = u_ID
WHERE
p_Paid = 0 OR p_Enabled = 0 AND p_CustomerID <> 4
ORDER BY " & orderby
The problem is that both tblPropertyInfo and tblUsers contain a column p_Type. In tblPropertyInfo, p_Type stores what type of property it is and this is the value we want to display in the table however I suspect this is being overwritten by the p_Type from the tblUsers table which is mostly NULL values so returns empty cells in the table.
I don’t want to start playing with the table structures because they are used all over the site if I change it in one place will have find every single reference to it and update them all.
Is there a way I can specify which table to pull the column from?
Value is currently called using:
<%=rsProperty("p_Type")%>
Thanks
Try:
If that doesn’t work, you could modify the query to return only one type (and any other column you may want):
If you’d like to keep using
*, you could use an alias:Which you could reference like: