My mgr wants to know
- # of times a particular kind of service (Service ID - AAA) was done on a particular kind of program (Program ID - SP) in 2005
- what is the Service percentage? For example, service was done 40% of the time
- Average cost of the service for those programs that had it
I am trying to come up with a way to save the IP of the last computer that ran an update in our servers. I don't want to have to re-write the .net code, so I am wondering if there is a way, using functions available in SQL 2000 that I can get the IP of the machine running the update. I know that SQL server 'knows' this information because it can log it in it's log files, but I don't know how to get at it from a stored procedure. Thanks.
I am trying to create a query which should return 4 columnsFacility | NoOfActiveApplicants | NoOfArchivedApplicants | TotalApplicantsI would be glad to even have just 3 columns since, the Total can be computedin the display table (ColdFusion interface)Facility | NoOfActiveApplicants | NoOfArchivedApplicantsSo far I have the following query, which returns just 2 rows with bothNoOfActiveApplicants & NoOfArchivedApplicants under the same column.Am stuck here, any help is apprecialted. Thanks in advance!selectNoOfApplicants= sum(case when a.id <> 0 then 1 else 0 end), Facility = case when c.facility is null then c.JobDBFacilityName else c.facility endfrom tblapplicant a, tblJobDB b, tblfacilities cwhere a.jobid = b.jobidand b.facility = c.facilityidgroup by c.facilityid,c.JobDBFacilityName,c.facility,b.faci lityunion allselectNoOfApplicants= sum(case when a.id <> 0 then 1 else 0 end), Facility = case when c.facility is null then c.JobDBFacilityName else c.facility endfrom tblArchiveapplicant a, tblArchiveJob b, tblfacilities cwhere a.JobVacancyNumber = b.JobVacancyNumberand b.facility = c.facilityidgroup by c.facilityid,c.JobDBFacilityName,c.facility,b.faci lityorder by facility
How can I write a query to output the balances of unpaid invoices into aging columns? I have invoices, lineitems, and payments tables. I have a query that will join the 3 tables to determine which invoices are unpaid. I need to write an aging report in Access 2000 with the unpaid invoices listed with the balance under the proper heading (ie:<30, 30-60, 60+). Any ideas on how to do that? I can write a query to pull one date segment at a time but I can't get them all into one query with different headings to base a report on. My customer had it working in Access 2000 but he upgraded to SQL Server 7 with an Access 2000 Project as a front end and we can't get it to work. It's driving me crazy! TIA!!!
CREATE TABLE [Perf] ([TransId] INTEGER,[FileNo] VARCHAR(80),[TimeInSeconds] INTEGER,[FileSizeMB] INTEGER,[FileName] VARCHAR(255),[StartDate] datetime)Ok!! Here's the Problem. I am working on a perf stats report. FileType is First 9 chars of the field FileName. I need to compare a similar filename from this month to last month or before ordered by file size. Maybe this is a very simple query but currrently my mind refuses to work. Seeking F1.
I have created a report in visual studio 2013 that talks with my SQL server through data connections. I want to be able to query my report BY HOUR. Meaning, I want the report to gather values at 14:30, 22:30, and 06:30. Here is my nonworking code so far.
AND DATEPART(hh,[datetime]) = 0630 AND DATEPART(hh,[datetime]) = 1430 AND DATEPART(hh [datetime]) = 2230
Hello all,I need to do the following task repeatedly. I have been doing itmanually until now and I am thinking if there is any way I couldautomate the whole process.Here is the task:For a selected group of tables, I need to create an Excel file with oneworksheet per table. The worksheet contains information about thetable.Here is an Example of Person table with fields PersonId, LastName,FirstName ...Column Name -> PersonId LastName FirstName ...Type -> char char char ...Length -> 6 50 50Data -> P00001 Smith John .... P00002 Smith Joan ...
Hi, it's my first time for using report model as the datasource of reporting service. But I don't know how to build the query string to get data from the report model. Can anyone help me?
What needs to be done to allow a user to input data in a "From query report parameter"?
The "From query" option was used to show all possible selections the user can do but what if the user would now like to select for partial key...i.e.: like '%tss%'
I would like to avoid the Multi-Value parameter option.
NOTE: The report is done through Microsoft Visual Studio / RDL.
I am running MSFT SQL 2008 with a CRM system. In that CRM system we have defined "COMMUNICATIONS" that have a number of different "TYPES" These communications are tied to Companies, which in our business is a resident of our community. The resident has the ability to request a 1 time service (TRAVEL) that would be recorded with one "COMMUNICATION" , or a reoccuring service (DAILY CARE) that would be recorded with two "COMMUNICATIONS" (Start/Stop). THe communication ID does appear to be sequential, but may not be entered sequentially.
we would like to be able to create a timeline for a specific resident around 3 specific types of transactions. (AWAY, RETURN, CS) There should be some strong predictive value to these data points.
ABSENCES AWAY = Start of an absence from the building RETURN = End of an absence from the building A person during their reisdency will have multiple Absences An absence could start on the same day a previous absence ends Absences vary in length CS CS0-CS10 (each is a different TYPE) of communicatio
[code]....
Query in DESIGN View
SELECT TOP 100 PERCENT comm_trantype AS Type, comm_trandate AS Date, CmLi_Comm_CompanyID AS CompID, Comm_CommunicationId AS CommID, ROW_NUMBER() OVER (PARTITION BY CmLi_Comm_CompanyID ORDER BY Comm_CommunicationId, comm_trandate) AS Seq FROM CRM_CSLDB.dbo.vCommunication
[code]....
Results from QUERY in DESIGN VIEW
TYPE DATECOMPIDCOMMIDSEQ AWAY2011-02-24 00:00:00.00051747531 RETURN2011-03-31 00:00:00.00051747542 AWAY2011-03-28 00:00:00.00064740681 RETURN2011-04-30 00:00:00.00064752972
SELECT TOP (100) PERCENT dbo.vCommunication.comm_trantype AS csTrans, dbo.vCommunication.comm_trandate AS csTranDate, dbo.vCommunication.CmLi_Comm_CompanyID AS CompanyID, dbo.vCommunication.Comm_CommunicationId AS Comm_ID, dbo.CSL_resident.Name, Comm_CommunicationId AS CommID, ROW_NUMBER() OVER (PARTITION BY CmLi_Comm_CompanyID ORDER BY Comm_CommunicationId, comm_trandate) AS Seq FROM dbo.vCommunication INNER JOIN
i have a problem with a report. if i try it with vs2005 and the preview it works. if i call the report from my web-application i get no error-message, but i only get my headlines and no query-results.
i use reportingservices 2005, vs2005 and .net 1.1 my datasource is an olap-cube.
I have created a model from the underlying database. Now I want the capability to write SQL Queries when creating reports instead of drag and drop the reports. Is there anyway we can achieve it in MS Report Builder. I would like to know the options available in MS world on this.
Is their a way when creating a Report Builder model to set a query timeout? Similar to what can be done when creating a Reporting DataSet in VS.NET during report development.
My ultimate goal is to be able to limit ad-hoc report users running Report Builder from waisting resources on my SQL instance. This has nothing to do with a report being published to a report server and setting a reports execution time limit.
I am newbie and i am working on SSRS to create some reports.
I have a reprot where i am displaying ProviderNos in the first column and based on provider i need to get some other information from another database and display it in the same line with Provider.
Below is my report format.
ProviderNo Speciality 1111111 A 2222222 B 3333333 C
The problem is, PrivderNos are from different database so i am getting it in separate Dataset. And Speciality is in Different Database so i am getting it in separate dataset. But i want both of them to be displayed in same table on report.
Below is the query for ProviderNos: Select Prv_No from server1.database1.dbo.Providers where MemberNo='xxxxxx'
Below is the quer for getting Speciality: Select Speciality from server2.database2.dbo.Prv_SP where prv_no IN (@prvno)
If i am assigning SpecialityDS to the table, it displays correct values for each n every provider. But i dont know how do i make it in such a way that it displays the result as above format.
Is there a way to create an expression that references the DataSets / Queries? I'd like to be able to create an expandable text box that shows the raw sql query used to generate the report.
I need to create multiple reports with each report being sent to the specified user. For example, 3 Managers should each get their own report. A Stored Procedure receives a ManagerID parameter, so I need 3 instances of the report. I also need each report to be sent to its associated Manager:
Mgr ID Manager Name
1 John Q Manager
2 Jane Q Manager
3 Jack O Lantern
I set up a rss file to run the report and can run it multiple times, passing in a different ID value each time, but it will not be data driven because I must hard-code the parameters in the ReportParmaters object of the report for each execution.
Is there a way, either by designing the report in VS2005 or on the Reporting Services server, to accomplish what I'm intending to do?
Hi all, I've been building a set of traffic based reports on our website and I've run into a strange problem.
The reports are pretty basic, and up till now I've been really impressed with RS overall.
Recently I've added a StartDate and EndDate and since then the performance has gone from ~10 secs to ~10 minutes.
I've taken a really simple query from my reports. Running this query in Management Studio on the same data returns in less than a second. When its run from a test report with nothing else in it it takes ~1 minute. Even stranger when I run the same query with the same values for parameters inside of RS in the data view it takes less than 1 second. ARG!
SELECT COUNT(DISTINCT SessionID) as Occurences FROM WebAppSummary JOIN WebAppLocalizations ON WebAppSummary.ClientIp = WebAppLocalizations.ClientIp where FirstTime BETWEEN @StartDate AND @EndDate
The last line that was just added is this part: where FirstTime BETWEEN @StartDate AND @EndDate
So whats going on here? Is this a really poorly performing query that management studio is optimizing but RS isnt? Is RS messing up the databind and getting a bunch of DSs instead of just one?
Hi all - struggling a bit with this one... I have made an accounts application and need to make a report called "Aged Debtors". It lists all of the clients with outstanding invoices and breaks them down into periods:
current (this month) period 1 (last month) period 2 (2 months ago) period 4 (invoices raised 3 months ago or more)
My tables are as follows (simplified)
Clients clientid int clientname varchar(100)
invoices invoiceid int clientid int invoicedate datetime cinvoiceamount decimal(19,2) paid int (1 = paid, 0 = unpaid) paidamount decimal(19,2) (how much of this invoice has been paid)
I need the following columns in the report
clientname invoiceid current period1 period2 period3+ test client 1 £100 - - - 2 £50 - - - 3 - £100 - - test client2
I can format all the report using a matrix in SSRS so just need the stored proc to get me going - any help greatly appreciated! Thanks guys, Stephen.
I added a Named Query on my existing data source view and I recreate the report model, however, I am unable to see the Named Query on the Report Model, I can see only the tables.
I need to disaplay number of Active Agencies on monthwise in one of my report. I have tbl_Agency table with ActiveDate and ActiveFlag. ActiveDate column contains always first Activation Date. If any chances in the agencies(update/delete) the same record will move to tbl_AgencyHistory table.
"If an agency is inactivated in September 10th, inactivated all of October, and then reactivated November 10th - the agency would be counted in September, not in October and counted in November"
ActiveDate column has always first activation date, I could not meet this requirement. This is very urgent issue, Could you please help me on this.
I want to create a report based on above three tables It looks like as follows;
Program Summary
Yesterday/Current MTD Previous Month YTD
Amount Number Amount Number Amount Number Amount Number
Portfolio
Loans Commenced
$ # $ # $ # $ #
Loans Closed
$ # $ # $ # $ #
CDs Commenced
$ # $ # $ # $ #
CDs Closed
$ # $ # $ # $ #
Loan table - Amount, State CD - Amount, State Account - CommencedOnDate(date time), closeondate(date time)
Yesterday - Loans/CDs started yesterday(calander date..not last 24 hours) MTD - " " First of this month to yesterday Previous Month - " " during previous month YTD - " " Loans/CDs started from 1 of this year to yesterday
Loan and cd states are Commenced and Closed
Based on this I have to create a report. But this time format seems to be really complex. Can anyone help me to write the query pls?
I am trying to create a report against an Access 2003 database using the provider as follows: "Provider=Microsoft.Jet.OLEDB.4.0;"
Simple reports with no parameters are fine (e.g. using a text query of 'Select * from BERs'
But how do I pass in a report parameter to limit the results coming back ? I have only used stored procs in the past which work fine but how to achieved this using Access has me stumped.
An example query I need would be 'Select * from BERs WHERE Year = [Year?]'
Hi Guys, I am generating Transaction Activity report,which should get data by weekly.Report shold look like this.
W1 W2 W3 W4 W5 W6
OKC 79 38 50 76 35 47
NFL 0 0 45 43 33 28
LA
5
12
10
0
0
10
Total 79 38 95 119 68 75
Iam passing 3 parameters @startdate,@enddate,@Market. when i select one Market(OKC/NFL/LA), report generating properly, but when i passing 3 markets values(OKC,NFL,LA), iam getting wrong report,report format is not correct.I used Cross tab for generating this report.Result lam getting like this.
W37 W38 W39 W40 W41 W42 W43 W44 W45
OKC 80
OKC
38
OKC
95
OKC
119
OKC
68
OKC
75
OKC
74
OKC
70
OKC
59
OKC
OKC
LA
And i wrote query like this,
select m.Market_name as Market,'W'+datename(ww,ut.creation_date) as Week,count(ut.transaction_id) as Count from POS.DSC_TRANSACTION_STATUS_VL ts inner join POS.DSC_USER_TRANSACTION ut on ts.transaction_status=ut.transaction_status inner join POS.RETAIL_LOCATION rl on ut.rl_number=rl.rl_number inner join POS.BILLING_MARKETS bm on rl.bm_code=bm.bm_code inner join dbo.Market m on bm.market_id=m.market_id where (ut.creation_date between @startdate and @enddate) and m.market_name IN(@Market) group by m.Market_name,ut.creation_date order by m.Market_name desc
Could you please some one help me to get this correctly.
No matter how I try to enter an automatic query parameter it just isn't recognized as such. I get missing expression errors from the SQL syntax check and no report variables are generated. There must be something incredibly simple that I am missing....
The most recent query string I've entered is
SELECT DISTINCT WRTE_ROUTE FROM WSMGR.WIPRTE WHERE WRTE_RT_GRP_1 = 'RULE_BASED' AND WRTE_FACILITY = @Facility
I'm having a heck of a time with named queries. At this point I just want a proof of concept in my DSV. I have a bunch of tables added to the DSV, and I would like to add a named query to it so the user can pick from the name query in report builder. What has to be done to make it appear in the report builder?
I am creating a sales report that needs to display Sales statistics for a selected month grouped by Material. Also, it needs to display the same stats for the selected month of the previous year. Finally, it needs to display Year To Date Statistics for the current year and previous year up to and including the selected month.
Currently, I am using 3 queries to do this. The first one gets the statistics the current month grouped by material. The others sprocs get their corresponding information by me passing in the material number and the month and doing the appropriate sum. So, essentially, for a single line of the report, 3 queries are being done. The problem arises in that sometimes there may be as many as 300 materils displayed in a given month, which amounts to alot of db activity and a long delay loading the report.
Is there anyway to get this information in one swoop using some fancy aggregation?
I want to write a query to generate a report. I have a date column which will be holding all the business dates. No dates of Saturday and Sunday are allowed. What I am looking for is, I want to get the result of every 5th business day of each month. A month could start with any day. I just want only the 5th business day.