Floetic Posted May 16, 2007 Share Posted May 16, 2007 -- (1) Number of calls received for each priority of call [for a specified date range] declare @startdate datetime, @finishdate datetime select RM.fldPriorityCode as 'Priority', count(RM.fldRequestID) as 'Calls' from tblRequestMaster RM where RM.fldPriorityCode between 1 and 5 and RM.fldRequestDate between '01-01-2007' and '03-05-2007' and RM.fldRequestFlag like 'D' group by RM.fldPriorityCode union select 'Total' as 'Priority', count(RM.fldRequestID) as 'Calls' from tblRequestMaster RM where RM.fldPriorityCode between 1 and 5 and RM.fldRequestDate between '01-01-2007' and '03-05-2007' and RM.fldRequestFlag like 'D' order by RM.fldPriorityCode asc Results: Priority Calls 1 20 2 2912 3 152 4 571 5 4 Total 3659 I would like to transfer these results to an excel sheet. For instance when the user opens up the excel worksheet and types in for a example a start date: 01-01-2007 and an end date: 03-05-2007 (into textboxes) then clicks a button say called 'Get stats' and then the results appear on the sheet. How can this be done? Quote Link to comment https://forums.phpfreaks.com/topic/51651-transfer-sql-data-results-to-excel-sheet/ Share on other sites More sharing options...
o3d Posted May 30, 2007 Share Posted May 30, 2007 in excell you have an option in 'data'->'import external data'->'new database query' have a read on that, it is similiar to what one of my clients wanted to use, i basically formulated the query in excell and gave the client the excell file. When the file is opened, it will prompt for a database username and password (depending on how you set up the db connection in excell). Quote Link to comment https://forums.phpfreaks.com/topic/51651-transfer-sql-data-results-to-excel-sheet/#findComment-264536 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.