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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Select columnsnames with "." in the name

Hi all,

 

I have a problem as I want to collect only a few columns from a table. But the column name in the database have a "." in it, which gives an error: extraneous input '.0' for example. In the column alrmbitsfeeddrive.0.

 

Here my query, how can I make it so power bi sees it as a column name. 

 

= Odbc.Query("dsn=" & ConnectionName & "", "
SELECT timestamp,

runningshours,

alrmbitsfeeddrive.0, 
alrmbitsfeeddrive.1,
alrmbitsfeeddrive.3,
FROM " & TableName & "
WHERE serial_number = XXXX
ORDER BY timestamp ASC
")

 

Hope you can help me

 

 

2 REPLIES 2
Stachu
Community Champion
Community Champion

Depending  on the version of the SQL you are running, wrapping the column names in [ ] , ' '  or `` may work


You could also connect to the database and create this query with the UI and query folding (if your source is supported)
https://devinknightsql.com/2016/07/03/power-bi-checking-query-folding-with-view-native-query/

and the SQL will be generated as the Native Query



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Anonymous
Not applicable

Thanks for your help, but I have used [] and '' and "". All give the same error.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors