Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

type mismatch expression when querying 2 tables

Status
Not open for further replies.

gavray

Programmer
Jul 17, 2000
65
GB
hi,

If you look at the code below, what I'm trying to do is display info from both tables
The jobtable has the companies id for each job, but the strID relates to the actual job id.

I'm getting an error 80004005

type mismatch in expression, can anyoen help


sSQL="SELECT JobTable.*, CompanyTable.* FROM JobTable, CompanyTable"
sSQL=sSQL & " WHERE CompanyTable.ID = JobTable.CompanyID"
sSQL=sSQL & " AND JobTable.ID= " & strID & ""
sSQL=sSQL & " ORDER BY JobTable.Salary;"

Gavin
 
Try not putting the & "" at the end of the third line.

Simon
 
On both suggestions it produced the same problem.):
 
Gavin,

Try writing the value of sSQL variable out to the browser and then copy and past the sql statement into your database environment and execute it in there. The error you are getting is from your DB not from ASP.

-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top