Microsoft Query does not save returned data to spreadsheet

When I run the sql Query below, Microsoft Query returns data from the SQL Server DB as expected. But when I try to import the result data (as table) in the current spreadsheet, no data is returned and I receive no error message (only a short text message like "Running query").

Any suggestions on possible explanations?

How can I get some debug information on the result data import to the spreadsheet?

(I am using MS Office Professional Plus 2010).

Regards

Frank Krogh

------

DECLARE @productionId AS int = 73 

DECLARE @postalDeliveryId AS int = 73819; 

SELECT hosptialUnit, referralPeriodID , patientNo, referralDate, inDate, inTime, outDate, outTime, fromReportPeriod, ROW_NUMBER() OVER (PARTITION BY referralPeriodID ORDER BY inDate ASC, inTime ASC, outDate ASC, outTime ASC) AS rowNo1 

FROM [nationalDB].[natonalFile] 

WHERE productionId = @productionId AND postalDeliveryId = @postalDeliveryId AND contactType IN ('1', '2') AND referralDate > fromReportPeriod

August 27th, 2015 5:48am

Hi Frank,

You can try to use a simple query syntax (like SELECT * FROM  [nationalDB].[natonalFile] ) to test that the query can return the expected result. Maybe you have a lot of records, and this caused timeout.

Free Windows Admin Tool Kit Click here and download it now
August 31st, 2015 5:05am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics