Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
RaphaelPavanBR
Frequent Visitor

Using a Column with reserved words inside ODBC connector

Could someone help me?

I am using ODBC connector to use a server where I query the following:

 

Fonte = Odbc.Query("dsn=default-server", "select "from".taxid from clients")

 

I have this database in which I am only a user and can't change the column names, so that is not an option.

I found in another forum that using #"" could solve the problem, but I already tried:

 

[#"from"].taxid

["from"].taxid

[from].taxid

"from".taxid

#"from".taxid

 

But power bi keeps returning the same error: "the ',' token was expected". 

 

The query works when I run it in a SQL only environment using "from".taxid, but Power Bi is not accepting it 😞

1 ACCEPTED SOLUTION
RaphaelPavanBR
Frequent Visitor

After weeks of struggle I finally found out a solution.

One should use double double quotes to achieve what I wanted. Such as:

""from"".taxid

 

I found it really unusual and not friendly at all, but at least solved my problem.

View solution in original post

3 REPLIES 3
RaphaelPavanBR
Frequent Visitor

After weeks of struggle I finally found out a solution.

One should use double double quotes to achieve what I wanted. Such as:

""from"".taxid

 

I found it really unusual and not friendly at all, but at least solved my problem.

Anonymous
Not applicable

Hi  @RaphaelPavanBR ,

 

You might consider using double quotes or square brackets to escape reserved words

Odbc.Query("dsn=default-server", "select \"from\".taxid from clients")

OR

Odbc.Query("dsn=default-server", "select [from].taxid from clients")

This is the related document, you can view this content:

sql - How to escape double quotes in a column name when querying Excel file using ODBC - Stack Overf...

blog.crossjoin.co.uk

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Neither of your formats worked. Both gave the same error.

Brackets:

RaphaelPavanBR_0-1722445006023.png

counter bars with double quotes:

RaphaelPavanBR_1-1722445064005.png

 

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.