Knowledgebase: TroubleShooting
[QODBC-Desktop] Troubleshooting: Expected lexical element not found
Posted by Rajendra Dewani (QODBC Support) on 31 October 2012 11:51 AM

Troubleshooting: Expected lexical element not found

Problem Description 

When trying to execute a query statement, I get the error message " Expected lexical element not found "


It seems to be the issue in the SQL Statement. Please check all the field names and table names.  Normally this could be a typo error in the field name in your SQL Statement.  To know more about the fields and data layout, please Click Here 

Another Possible Problem & Solution:

Problem Description:

When I issue SQL statement:

SELECT Desc FROM Charge 

I get "Expected lexical element not found: = <identifier>"

However, if I issue

Select * from Charge

Then, I get a full output, with one of the columns named "Desc".

Why can't I query for the column by name?

I have tried this through the QODBC Support Wizard and through a C# program as well. 


I would like to inform you that Desc may be a reserved word in SQL; due to this, you are getting this error. I kindly request you to please put quotes around "Desc". Please use the below query, which does not issue an error:
SELECT "Desc" FROM Charge 



(5 vote(s))
Not helpful

Comments (2)
Ricky Bowman
12 February 2018 05:31 PM
I get the same error message when running a query in Microsoft Query against the customer table in quickbooks. I modified the query to only select one column and still get the same error. My query is: select listid as id from customer.
13 February 2018 01:36 PM
Hi Ricky,

Please use below query & check again:

select listid as “id” from customer

If you are still the facing issue, Please raise a support ticket to the QODBC Technical Support department from below mentioned link & provide requested information:

We may need the following information, Please attach below listed files when replying to the ticket.
1) Screenshot of QODBC Setup Screen -- > About
2) Screenshot of the issue you’re facing.
Share Entire Log Files as an attachment in text format from
3) QODBC Setup Screen -- > Messages -- > Review QODBC Messages
4) QODBC Setup Screen -- > Messages -- > Review SDK Messages
Refer: How to take screenshot:

Post a new comment
Full Name:
CAPTCHA Verification 
Please complete the captcha below (we use this to prevent automated submissions).