View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Blondie Blondie is offline
external usenet poster
 
Posts: 12
Default Importing stored procedures into Excel with parameters

I wish to import the results of a sql stored procedure into Excel. The
stored procedure has two date parameters yyyy-mm-dd and an interger
subscription id parameter. The user needs to be able to change the dates and
subscription id.

I haven't been able to set the import up without putting in fixed dates and
a subscription id as Microsoft Query doesn't allow parameters to be set up if
the query can't be represented geographically
e.g.
exec dbo.sp_AutomatedStatsByMonth @DateFrom='2008-05-01',
@DateTo='2008-05-31', @SubscriberID='4603345'

If I change the parameters to '?' the error returned is - Error converting
data type varchar to datetime.