Does anyone know if SSRS2008 includes KPI's such that you can include them while working in Visual Studios? I've seen some "work arounds" posted but if 2008 includes them I'll just load that up and see.
I would like to perform a procedure which takes a string of numbers and searches for strings in a table which include all the given numbers in any particular order. problem is i can only return strings which include 'any' of the letters in the search string and not 'all'.
this is how i perform it so far:
@IncludeNumbers VARCHAR(50)
AS BEGIN
SELECT Phone AS [Telephone Number]
FROM tbl_Person AS p
WHERE (p.Phone LIKE '%[' + @IncludeNumbers + ']%')
END
(ive removed some unecessary bits but this shows the basics)
As you can see currently it will return any phone numbers which contain any numbers given in the includeNumbers string, I would only like it to return phone numbers which contain all the numbers given in the includeNumbers string. is there any way to make it search for strings which include 'all' numbers given?
i am having a problem querying a field in a database to show all records where the title has a keyword within the title. Select * FROM tblCourse WHERE title =@Search But not the full title just a keyword within the field? Thanks
The following query is failing when trying to apply the MAX(field_x_order) to the variable @max Note the x is represented by the string variable @stri
declare @i int declare @stri varchar(10) declare @max int set @i = 18 set @max = 0 while @i < 49 begin set @i = @i + 1 set @stri = cast(@i as varchar(10)) select @max = MAX(field_ + @stri + _ORDER) FROM table_name WHERE field_ + @stri + IS NOT NULL -- error: Incorrect syntax near the keyword 'IS'. exec ('UPDATE display_1a SET field_' + @stri + '_order = field_' + @stri + '_order ' + @max + 'WHERE field_' + @stri + ' IS NULL') end
I have also tried: select MAX(field_ + @stri + _ORDER) INTO @max = FROM display_1a WHERE field_ + @stri + IS NOT NULL -- error: Incorrect syntax near '@max'.
and: select @max = ('SELECT MAX(field_' + @stri + '_ORDER) FROM display_1a WHERE field_' + @stri + ' IS NOT NULL') -- error: Conversion failed when converting the varchar value 'SELECT MAX(field_19_ORDER) FROM display_1a WHERE field_19 IS NOT NULL' to data type int.
i am trying to create a view but i keep getting the error 'View definition includes no output columns or no items in the FROM clause.'
below is the select statement that's the basis of my view. the explanation i got from the F1 help of enterprise manager was ... View definition includes no output columns or no items in the FROM clause. A view definition must have at least one table or table-structured object in the FROM clause, and must have at least one column in the select list. The view definition is missing one or both. Modify the view definition accordingly.
query:
select Case_CaseId, Logged, CAST(DATEDIFF(minute, Logged, Waiting)/60.0 AS NUMERIC(9, 2)) AS Waiting, CAST(DATEDIFF(minute, Logged, Investigating) /60.0 AS NUMERIC(9, 2)) AS Investigating, CAST(DATEDIFF(minute, Logged, Rejected) /60.0 AS NUMERIC(9, 2)) AS Rejected, CAST(DATEDIFF(minute, Logged, Resolved) /60.0 AS NUMERIC(9, 2)) AS Resolved, CAST(DATEDIFF(minute, Logged, Solved) /60.0 AS NUMERIC(9, 2)) AS Solved, CAST(DATEDIFF(minute, Logged, Closed) /60.0 AS NUMERIC(9, 2)) AS Closed from (
SELECT Case_CaseId, MIN(CASE WHEN case_stage = 'Logged' THEN Case_CreatedDate END) AS Logged, MIN(CASE WHEN case_stage = 'Waiting' THEN Case_CreatedDate END) AS Waiting, MIN(CASE WHEN case_stage = 'Investigating' THEN Case_CreatedDate END) AS Investigating,
AS Rejected, MIN(CASE WHEN case_stage = 'Resolved' THEN Case_CreatedDate END) AS Resolved, MIN(CASE WHEN case_stage = 'Solved' THEN Case_CreatedDate END) AS Solved, MIN(CASE WHEN case_stage = 'Closed' THEN Case_CreatedDate END) AS Closed FROM CaseProgress GROUP BY Case_CaseId ) as temp order by Case_CaseId
I am wondering if some of you T-SQL pros encountered a situation when you have a parameter that can consist of multiple strings. For instance, I have a stored procedure called dbo.usp_CalculateHeadcount that accepts two parameters such as @Term, and @AcadLevel.
It works great when my parameters are two single strings; 'Fall2007', 'UG'. But let say I have one more term such as 'Fall2006' and want to pass it to a stored procedure, the problems start to appear.
It doesn't work because I have added an extra string and stored procedure thinks it is another parameter. Is there a way to handle problems like the one above?
Hi, not too swift with anything other than simple SQL statements, soI'm looking for some help.Using SQL Server 2000 with this stored proc:(@varCust varchar(50))ASSET NOCOUNT ONSELECT d.WorkOrder, d.Customer, d.SerialNo, d.Assy, d.Station,d.WIdoc,d.Start, d.StartUser, d.Finish, d.FinishUserFROM tblWorkOrder w, tblDocs dWHERE w.WorkOrder IS NULL AND w.WorkOrder = d.WorkOrder ANDd.Customer = @varCustGOI'm trying to get a complete dataset so I can simply apply it as thedatasource to a datagrid in asp.net. I need to include a 'TimeSpan'column that is the difference between d.Start and d.Finish. I alsoneed it to present in hh:mm:ss format in the datagrid column. (A) isit possible to do this within the stored proc, and (B) how would "I"do that?Thanks!Kathy
Can I specify a collate value for a column in a table that includes all the possible languages in the world or atleast Latin 1 and Eastern European languages.
My DB Collation is set to Latin 1 and the columns in the tables are all nvarchar or ntext, but certain hungarian characters are not displayed correctly.
What do all these collation codes represent:
SQL_EBCDIC037_CP1_CS_AS
211
SQL_EBCDIC273_CP1_CS_AS
212
SQL_EBCDIC277_CP1_CS_AS
213
SQL_EBCDIC278_CP1_CS_AS
214
SQL_EBCDIC280_CP1_CS_AS
215
SQL_EBCDIC284_CP1_CS_AS
216
SQL_EBCDIC285_CP1_CS_AS
217
SQL_EBCDIC297_CP1_CS_AS
They seem generic. Is there one collation that includes all the Eastern Europen Languages and Latin 1 charset. Please let me know.
I am trying to write a report that includes different lab values for an account number depending on the test. What I mean is if patient xyz had lab work and procedure number 1012 was ordered I need to include one line for the highest result value and one for the lowest result value. If I have procedure number 1032 I only need a line for the lowest value. I have a list of about 40 lab procedures that some require both highest and lowest, some just the lowest and some the highest. I have played around with CASE, but that hasn't worked for me.
In our Microsoft Dynamics Nav instance we have a Sales Header Archive table - into which copies of the Sales Header are placed, with 3 items forming the compound key:
Document Number Version Occurrence number
so if doc 1 is archived, then the records would be
Doc# | Version | Occurrence # 1 | 1 | 1
When a second copy is archived a new record is added:
Doc# | Version | Occurrence # 1 | 1 | 1 1 | 1 | 2
and then when maybe a 3rd version is archived a 3rd entry added
This is for EACH document and I now need to retrieve the dataset which is the latest version of each document... but I'm drawing a blank!
If I
select [Doc#], max([Version]) as [V], max([Occurrence #]) from (table) group by [Doc#]
then I get the distinct list of docs, but I now need to use this list to select the records which match this criteria, from this table.
How do I select just these?
I thought (wrongly) that I could simply say:
Select * from Invoice Table where Invoice.[Doc#], Invoice.[V], Invoice.[Occurrence #] in (select [Doc#], max([Version]) as [V], max([Occurrence #]) from (table) group by [Doc#])
SO I have a need to to limit the members of a dimension that get included with a query to just a few. So that means specifying which ones. How do I limit the main set based on a defined list of members in one of the dimensions im using.
In the query below, I need to limit the number of dimension members being included for CommType and MetricType. I get errors if I use a list of specific members in a where clause that includes these same dimensions.
WITH MEMBER [Measures].[YTD Actual] AS SUM({[DimCalendar].[Month Year].&[2015]&[1] : STRTOMEMBER('[DimCalendar].[Month Year].&[' + CSTR(YEAR(NOW())) + ']&[5]') } , [Measures].[Actual]
I'm trying to create a proc for granting permission for developer, but I tried many times, still couldn't get successful, someone can help me? The original statement is:
I have an issue with a DTS package. We create a zip file and then attach it to emails going out using DTS. The problem is that the attachment, when received, is named using the full path to the file, so it is quite long.
Has anyone seen this before? Is there a way out of this?
I am considering mapping a drive to the share holding the file to be named, but the fact is this will shorten the name but will still result in the path being included.
I am wondering if this is a bug, as I suspect this isn't the default behaviour.
I have SQL Server 2012 SSIS. I have Excel source and OLE DB Destination.I have problem with importing CustomerSales column.CustomerSales values like 1000.00,2000.10,3000.30,NotAvailable.So I have decimal values and nvarchar mixed in on Excel column. This is requirement for solution.However SSIS reads only numeric values correctly and nvarchar values are set as Null. Why?
Hello I'm newbie to SQL Server and I have a problem that I'm having dificult to solte. I have 2 tables one called st and another called inventario. Both have a field named ref. but st.ref have a data like 00222 and the inventario.ref have only 222. I want to test in a query a think like this : Select * from inventarios where ref in(select ref from st) It gives me less results because it only identifyes the correct data and escape the ones that have 00 or 000 before the number. My question is if the any way to make this query but instead of equal, if it's possible to use some thing that compares this 2 fields, like field that includes the content of another field. Thanks in advance.