Skip to main content
Question

Excel as DB - Any ways to select a column name with a dot

  • June 10, 2022
  • 3 replies
  • 419 views

Forum|alt.badge.img+6
  • Navigator | Tier 3

Hi Experts,

 

I'm extracting some columns by connecting to excel as DB.

 

Select [Vendor name],[Value obj. currency],[Order] from [Sheet1] - This query isn't working due to the column name - Value in Obj. Crcy .. It throws invalid bracketing of name error .. Are there any ways to solve this without changing the column name? Pls suggest

3 replies

  • Navigator | Tier 3
  • June 13, 2022

@Ishwarya Kalidoss​  Try Select * from [Sheet1$$] instead, and export data to csv with Export data with Header - check ON, check the header it generates in csv, (seems like . converts to # here)


Forum|alt.badge.img+6
  • Author
  • Navigator | Tier 3
  • June 13, 2022

Thanks for your response. I'm trying to extract to a data table and tried Select [Vendor name],[Value obj# currency],[Order] from [Sheet1] replacing . with # but that dint work too.. Not sure about the SQL syntax to fetch such columns with a . in its name


Forum|alt.badge.img
  • Cadet | Tier 2
  • July 13, 2023

Hello, 

you should use SELECT [Vendor name],[Value obj# currency],[Order] FROM [Sheet1$$]

there should be two $$ after the sheet name