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