Here's a query that works just fine on my SQL Server Studio.
But when I run the same query through Excel (Data -> From Other Sources -> From Microsoft Query and select the appropriate Data Source Name and typing the query in the SQL Statement box), I get an error saying
"An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed. Change the alias to a valid name."
Interestingly, the same query with a '*' in the end works.
I feel It's something right in front of me and I'm not seeing it.
I'm using MS Office Pro 2010, SQL Server 2008 R2
Code:
select t.converted_date as AsOfDate, a.acc_name as Name, mvs_mkt as Prt, a.field_7 as AcctType
from IndataDB_MarketValues..tblMarketValues m,
IndataDB_MarketValues..tblDateTable t,
indatadb_main..rimsacc_Master a
where m.mvs_counter = t.counter
and convert(varchar,converted_date,101) = '06/30/2017'
and mvs_port-90000000 = a.acc_cust
and mvs_mkt > 1000000
But when I run the same query through Excel (Data -> From Other Sources -> From Microsoft Query and select the appropriate Data Source Name and typing the query in the SQL Statement box), I get an error saying
"An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed. Change the alias to a valid name."
Interestingly, the same query with a '*' in the end works.
Code:
select t.converted_date as AsOfDate, a.acc_name as Name, mvs_mkt as Prt, a.field_7 as AcctType, *
from IndataDB_MarketValues..tblMarketValues m,
IndataDB_MarketValues..tblDateTable t,
indatadb_main..rimsacc_Master a
where m.mvs_counter = t.counter
and convert(varchar,converted_date,101) = '06/30/2017'
and mvs_port-90000000 = a.acc_cust
and mvs_mkt > 1000000
I feel It's something right in front of me and I'm not seeing it.
I'm using MS Office Pro 2010, SQL Server 2008 R2