By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,495 Members | 1,110 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,495 IT Pros & Developers. It's quick & easy.

Runtime error 3075 with SQL statement

P: 2
"SELECT [HPD:HelpDesk].[Case-ID+], [HPD:HelpDesk].Category
INTO tblSiteGroupActiveTicketRawData FROM [HPD:HelpDesk
WHERE (([HPD:HelpDesk].Base = 'AAAA') OR ([HPD:HelpDesk].Base = 'BBBB')) AND ([HPD:HelpDesk].Status != 'Closed');"

Above SQL string fails with a runtime error 3075 syntax error (operator missing). I cannot figure this one out. Any assistance would be appreciated.
Jan 7 '08 #1
Share this Question
Share on Google+
5 Replies


JKing
Expert 100+
P: 1,206
"SELECT [HPD:HelpDesk].[Case-ID+], [HPD:HelpDesk].Category
INTO tblSiteGroupActiveTicketRawData FROM [HPD:HelpDesk
WHERE (([HPD:HelpDesk].Base = 'AAAA') OR ([HPD:HelpDesk].Base = 'BBBB')) AND ([HPD:HelpDesk].Status != 'Closed');"

Above SQL string fails with a runtime error 3075 syntax error (operator missing). I cannot figure this one out. Any assistance would be appreciated.

Hey there,

At a quick glance it looks like you're missing a closing bracket on your FROM line.

"SELECT [HPD:HelpDesk].[Case-ID+], [HPD:HelpDesk].Category
INTO tblSiteGroupActiveTicketRawData
FROM [HPD:HelpDesk]
WHERE (([HPD:HelpDesk].Base = 'AAAA') OR ([HPD:HelpDesk].Base = 'BBBB')) AND ([HPD:HelpDesk].Status != 'Closed');"
Jan 7 '08 #2

P: 2
I'm pretty sure that is a typo on my part in the forum as it is there in the actual string.

SELECT [HPD:HelpDesk].[Case-ID+], [HPD:HelpDesk].Category INTO tblSiteGroupActiveTicketRawData FROM [HPD:HelpDesk] WHERE (([HPD:HelpDesk].Base = 'AAAA') OR ([HPD:HelpDesk].Base = 'BBBB')) AND ([HPD:HelpDesk].Status != 'Closed');

I think I erased the bracket when I formatted it for easier reading. The string above is a direct cut/paste from the query.
Jan 7 '08 #3

jaxjagfan
Expert 100+
P: 254
I'm pretty sure that is a typo on my part in the forum as it is there in the actual string.

SELECT [HPD:HelpDesk].[Case-ID+], [HPD:HelpDesk].Category INTO tblSiteGroupActiveTicketRawData FROM [HPD:HelpDesk] WHERE (([HPD:HelpDesk].Base = 'AAAA') OR ([HPD:HelpDesk].Base = 'BBBB')) AND ([HPD:HelpDesk].Status != 'Closed');

I think I erased the bracket when I formatted it for easier reading. The string above is a direct cut/paste from the query.
Is "Status !" a field name?

SELECT [HPD:HelpDesk].[Case-ID+], [HPD:HelpDesk].Category INTO tblSiteGroupActiveTicketRawData FROM [HPD:HelpDesk] WHERE ([HPD:HelpDesk].Base IN ('AAAA', 'BBBB')) AND ([HPD:HelpDesk].[Status !] = 'Closed');

Just a habit but changed the OR to IN. Also make sure those same columns exist in "tblSiteGroupActiveTicketRawData " as they are in "HPD:HelpDesk". If not use "AS" to rename the "HPD:HelpDesk" columns.

The special characters (:,-,+,!) are not good to have as field names and makes things a bit more difficult to develop reports, queries, and to reference elsewhere.
Jan 7 '08 #4

JKing
Expert 100+
P: 1,206
I'm pretty sure that is a typo on my part in the forum as it is there in the actual string.

SELECT [HPD:HelpDesk].[Case-ID+], [HPD:HelpDesk].Category INTO tblSiteGroupActiveTicketRawData FROM [HPD:HelpDesk] WHERE (([HPD:HelpDesk].Base = 'AAAA') OR ([HPD:HelpDesk].Base = 'BBBB')) AND ([HPD:HelpDesk].Status != 'Closed');

I think I erased the bracket when I formatted it for easier reading. The string above is a direct cut/paste from the query.
Try this..

Expand|Select|Wrap|Line Numbers
  1. SELECT [HPD:HelpDesk].[Case-ID+], [HPD:HelpDesk].Category INTO tblSiteGroupActiveTicketRawData FROM [HPD:HelpDesk] WHERE (([HPD:HelpDesk].Base = 'AAAA') OR ([HPD:HelpDesk].Base = 'BBBB')) AND ([HPD:HelpDesk].Status NOT IN ('Closed'));
  2.  
Jan 7 '08 #5

JKing
Expert 100+
P: 1,206
The != operator is not recognized as being a proper operator.

The correct syntax for this operator is <>.

Example:
Expand|Select|Wrap|Line Numbers
  1. SELECT firstName, lastName
  2. FROM tblPerson
  3. WHERE firstName <> 'Bob'
  4.  
Jan 8 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.