This topic is locked

SQL Query help Please

3/7/2006 5:41:48 AM
ASPRunnerPro General questions
S
spanner author

Dear All
I am looking for some help please with importing a SQL query into ASPRunner. I have been reading the forums for the last week.
I understand that I have to import my database as a ODBC connection (this I have done) I then select the query (please see query below)
SELECT tblPersonnel.[First Name], tblPersonnel.[Last Name], tblPersonnel.[Employee ID Number], tblAsset.[Asset Type], tblAsset.Manufacture, tblAsset.[Serial Number]

FROM tblAsset INNER JOIN tblPersonnel ON tblAsset.[Employee ID Number]=tblPersonnel.[Employee ID Number]

WHERE (((tblPersonnel.[Last Name])=[LastName]));
My point of the query is to collect the asset information (Number of Asset items in there possession) from employees leaving the company.
But I don't seem to be able to get past the ASPRunner query window as I get the following error.
Cannot retrieve columns information. Please modify SQL query and try again.
Error message:

[Microsoft][ODBC Microsoft Access Driver] The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect.

I have read over the manual and looked all over the web trying to answer this question and I feel that it is likely my lack of knowledge when it comes to understanding SQL commands.
Any help would be much appreciated and many thanks in advance.

S
spanner author 3/7/2006

Dear All

I am looking for some help please with importing a SQL query into ASPRunner. I have been reading the forums for the last week.
I understand that I have to import my database as a ODBC connection (this I have done) I then select the query (please see query below)
SELECT tblPersonnel.[First Name], tblPersonnel.[Last Name], tblPersonnel.[Employee ID Number], tblAsset.[Asset Type], tblAsset.Manufacture, tblAsset.[Serial Number]

FROM tblAsset INNER JOIN tblPersonnel ON tblAsset.[Employee ID Number]=tblPersonnel.[Employee ID Number]

WHERE (((tblPersonnel.[Last Name])=[LastName]));
My point of the query is to collect the asset information (Number of Asset items in there possession) from employees leaving the company.
But I don't seem to be able to get past the ASPRunner query window as I get the following error.
Cannot retrieve columns information. Please modify SQL query and try again.
Error message:

[Microsoft][ODBC Microsoft Access Driver] The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect.

I have read over the manual and looked all over the web trying to answer this question and I feel that it is likely my lack of knowledge when it comes to understanding SQL commands.
Any help would be much appreciated and many thanks in advance.


Opps pressed the wrong button
Any case i have solved my problem. The Microsoft error gave it away in the end.
I had a couple of spaces in a few field names in one of my tables, when the ASP code is generated this does not like spaces and puts an under scource in for good measure hence the SQL query will not run because there is a name mismatch.