I access a stored procedure on a Microsoft SQL Server 2005 database within excel using
Select *
from [dbo].[fn_ph_by15minbyQueue] ('2013-09-01','2013-09-30','LocationCode')
in the data connection, which works fine.
I needed an additional column, so I altered the statement to
select *,
(case right([Interval],2)
when '15' then left([interval],len([Interval])-2)+'00'
when '45' then left([interval],len([Interval])-2)+'30'
else [interval]
end) as interval_30
from [dbo].[fn_ph_by15minbyQueue] ('2013-09-01','2013-09-30','LocationCode')
which works correctly within SQL Server, but when I enter that code into the Command Text, Excel reports:
Invalid object name 'dbo.fn_ph_by15minbyQueue'
What am I doing wrong?
Connection info:
Connection String:
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=BusinessUsers;Data Source=qadbs4784;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=XXXX;Use Encryption for Data=False;Tag with column collation when possible=False