Excel AsDB Query_1

Please assist me in fixing this query as I’m attempting to read data from an.xlsb file under specific conditions.

“SELECT * FROM [Base EBR+Manual Entry in Agg$] WHERE [BPC Country] = ‘CA’ AND [Net Units] = 0 OR [Net Revenue] IS NULL OR [Net Revenue] =(Blanks)”

Hi @km81

Try this-

“SELECT * FROM [Base EBR+Manual Entry in Agg$] WHERE [BPC Country] = ‘CA’ AND ([Net Units] = 0 OR [Net Revenue] IS NULL OR [Net Revenue] = ‘’)”

In this query, I have made a couple of changes:

  1. Added parentheses: The conditions ([Net Units] = 0 OR [Net Revenue] IS NULL OR [Net Revenue] = '') are grouped within parentheses to ensure the correct evaluation of the logical operators.
  2. Updated (Blanks) to '': Instead of using (Blanks) as a value, I have replaced it with an empty string ('').

Thanks!!

Hi @Nitya1
Actually, the query that you have provided is throwing an error, so I modified it but am still getting the same error. Please help on this
Run query: ERROR [07002] [Microsoft][ODBC Excel Driver] Too few parameters. Expected 1.

Modified Query : “SELECT * FROM [Base EBR+Manual Entry in Agg$] WHERE [BPC Country] = ‘CA’ AND ([Net Units] = 0 OR [Net Units] = ’ ')”

if possible provide the sample excel file

Regards

hi @LAKSHMI_NARAYANA_PEMMASAN
Sorry, I cant’ provide excel files as it is confidential data.

understand but you give some dummy data in same format , it should not actual data but replica of the file

Regards

@LAKSHMI_NARAYANA_PEMMASAN
I can’t do that, thanks a lot for your time

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