Hi
I am not sure how I can formulate this the best way, but I think I need to make a join query which I have never done before.
I got two tables tblProjects and tblCompany
I got an Ajax script which looks in the database for each letter which is typed into a search field for the company name.
In tblProjects I got a companyID field which will need to match an ID field in the tblCompany. The search field need to search in tblcompany.CompanyName for each letter typed in.
The below line does not work but I hope it gives an idea what I want to do :
SQLProjects = "SELECT tblProjects FROM tblProjects WHERE CompanyID = '" & Session("CompanyID") & "' AND tblCompany.CompanyName LIKE '" & right(request.querystring("q"),len(request.querystring("q"))-2) & "%' ORDER BY tblProjects.ProjectName
I am not sure how I can formulate this the best way, but I think I need to make a join query which I have never done before.
I got two tables tblProjects and tblCompany
I got an Ajax script which looks in the database for each letter which is typed into a search field for the company name.
In tblProjects I got a companyID field which will need to match an ID field in the tblCompany. The search field need to search in tblcompany.CompanyName for each letter typed in.
The below line does not work but I hope it gives an idea what I want to do :
SQLProjects = "SELECT tblProjects FROM tblProjects WHERE CompanyID = '" & Session("CompanyID") & "' AND tblCompany.CompanyName LIKE '" & right(request.querystring("q"),len(request.querystring("q"))-2) & "%' ORDER BY tblProjects.ProjectName