Microsoft ODBC Query for excluding a specific value from the column

I converted an Excel Workbook into a database using ODBC Data Sources.

Used the Run Query Activity in UiPath under the Database Activities and tried to extract data from the Excel in a particular column excluding a specific value in this case it is zero. Below is the query I tried to use but it returns the

"SELECT * FROM [Export Worksheet$] WHERE NOT CStr(INT_RECV_CLOSING_BAL)= '0';"

Am getting an error of:

Run query: ERROR [42000] [Microsoft][ODBC Excel Driver] Syntax error in string in query expression

Hi @Kakooza-Allan-Klaus ,

Please try this:
“SELECT * FROM [Export Worksheet$] WHERE CStr(INT_RECV_CLOSING_BAL) <> ‘0’;”

Thanks

1 Like

Same error results

Try

“SELECT * FROM [Export Worksheet$] WHERE CStr(INT_RECV_CLOSING_BAL) <> “0”;”

The syntax is wrong

Try this
“SELECT * FROM [Export Worksheet$] WHERE (INT_RECV_CLOSING_BAL) <> 0;”

I still don’t get my desired output using that

Example - [ColumnName]

Hello Good People,

I used a different Provider instead of the ODBC and it solved the issue.

This is the resource that I followed:

And that’s the query I used:

SELECT * FROM [Export Worksheet$] WHERE INT_RECV_CLOSING_BAL<> 0;

Best Regards,
Kakooza Allan Klaus

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.