Use Parameters/Prompts In Calculates Fields
May 22, 2008
Hello,
We want to have one prompt (parameter) to set a point in time, so we can use this parameter as filter in other elements.
e.g. We have a point in time prompt, that we can set and use to filter by examples illness records and availability record (by the same (one) prompt)
View 9 Replies
ADVERTISEMENT
Nov 20, 2015
I run these stored procedure to build the report and I am able successfully to build the report but I need some prompts to in the report to get the specific data .
ALTER
PROCEDURE [dbo].[Sharepoint_Ticket_Report]
@StartDate
DATETIME,
@EndDate
[Code] ....
And for prompts how to create created_by and message_type dropdowns as shown in picture.
View 7 Replies
View Related
Jan 2, 2008
Hi all,
I have an odd issue. I have a query that returns one row from SQL Server. The value for one column (payment) in this row is 5.00. There are no other rows returned, only one row. However, when I do a sum on payment it returns 195! I dont know where its getting this from, especially since I can see all the rows by removing the SUM() and there only is one row. Here is the query:Select v_payments.tripid, Instransporttotal, lastName, firstName, tripDate, v_payments.payment,credit, translation, inscoid, v_payments.checkid
from v_billbuckets
left join v_patient on v_billbuckets.patientID = v_patient.ssnleft join v_payments on v_billbuckets.tripid = v_payments.tripid
left join v_InsCompany on v_billbuckets.inscompanyid= v_inscompany.inscoidleft join v_billRecItem on v_payments.tripid = v_billRecItem.tripid
WHERE v_payments.checkID = 315898GROUP BY v_payments.tripid, Instransporttotal, lastName, firstName, tripDate, v_payments.payment, v_payments.credit, translation, inscoid, v_payments.checkid
The above query returns one row. However, If I put SUM() around v_payments.payment in the SELECT line then it is 195. I dont know why it is doing this. Any ideas?
Thanks!
John
View 2 Replies
View Related
Jan 18, 2007
I need to write a t-sql query that will take the value of the previousrecord into consideration before calculating the current row's newcolumn value...Here's the situation...I have a query which return the following table structure...Full_Name Points----------------- ------------Name1 855Name2 805Name3 800Name4 775Name5 775Name6 741etc.... etc...I need to create a calculated column that tells me where the personranks in point position. The problem i run into is that in thesituation where two or more people have the same point value i need thecalculated rank column to display the same rank number (i.e. 4th orjust "4") I'm not sure how to to take into consideration the previousrow's point value to determine if it is the same as the current onebeing evaluated. If i new they were the same i could assign the samerank value (i.e. 4th or just "4").If any one has any insight that would be great.ThanksJeremy
View 2 Replies
View Related
Apr 24, 2008
HI, SQL newbie here... less than a month. I am modifying a report from our MRP vendor. We are allowed to do this. They discourage modifying the underlying SQL for upgrade and support reasons. I need to pull commission data to the report in order to determine proper logo/address/etc information on the page. The report is about 1000 pages long, each page may have different logo, etc. So, I created a stored procedure in SQL to retrieve the data when passed a customer ID. Tests fine. When I attempt to call this stored procedure from reporting services, it tells me that I cannot use a Field (or report item) as a parameter. I cant believe they would limit reports this way. Is there any way to circumvent this limitation? Any alternate recommendations?
Thanks in advance!
Ray
View 1 Replies
View Related
Mar 7, 2006
Whn I use a UniqueIdentifier field as a parameter for SQLDataSource the parameter type defaults as an object. I just want to use the string value of the field.How do I do this?Thanks.
View 7 Replies
View Related
Sep 29, 2005
Hi to allI wish to be able to have a standard select statement which hasadditional fields added to it at run-time based on suppliedparameter(s).iedeclare @theTest1 nvarchar(10)set @theTest1='TRUE'declare @theTest2 nvarchar(10)set @theTest2='TRUE'selectp_full_nameif @theTest1='TRUE'BEGINother field1,ENDif @theTest2='TRUE'BEGINother field2ENDfrom dbo.tbl_GIS_personwhere record_id < 20I do not wish to use an IF statement to test the parameter for acondition and then repeat the entire select statement particularly asit is a UNIONed query for three different statementiedeclare @theTest1 nvarchar(10)set @theTest1='TRUE'declare @theTest2 nvarchar(10)set @theTest2='TRUE'if @theTest1='TRUE' AND @theTest2='TRUE'BEGINselectp_full_name,other field1,other field2from dbo.tbl_GIS_personwhere record_id < 20ENDif @theTest1='TRUE' AND @theTest2='FALSE'BEGINselectp_full_name,other field1from dbo.tbl_GIS_personwhere record_id < 20END......if @theTest<>'TRUE'BEGINselectp_full_namefrom dbo.tbl_GIS_personwhere record_id < 20ENDMake sense? So the select is standard in the most part but with smallvariations depending on the user's choice. I want to avoid risk ofbreakage by having only one spot that the FROM, JOIN and WHEREstatements need to be defined.The query will end up being used in an XML template query.Any help would be much appreciatedRegardsGIS Analyst
View 2 Replies
View Related
Jun 30, 2005
This question is for Bill directly. Hi Bill, I have lots of experience with RS, implementing the beta in a production environment, I was so impressed. Currently my company uses Cognos for financial reporting, and I am hoping to replace this with RS and MSAS. I have little knowledge of MDX, so I have been using your various series of articles to get up to speed. However, I don't get the article Mastering OLAP Reporting: Cascading Prompts. I fully understand how to build the prompts, but there seems to be a step missing in the article. You never replace the hardcoded where clause in the base dataset, and I can't seem to work out how to pass the parameter from the cascading prompts to the report. Maybe I'm being stupid, but the article doesn't seem to tell us how to do that.
Many Thanks
Sam
View 3 Replies
View Related
Nov 13, 2006
Hi guys
I have been asked to develop a query which when run will prompt the user to enter the number of months before runnin the query.
I know we can do this in MS Acess .
can we do the similar sort of thing in SQL as well??
My query is
SELECT DHBMappingTable.[DHB Name], Agency.DHB_service, PurchaseUnitMappingTable.PU, PurchaseUnitMappingTable.PU_name,
SUM([NMDS Data for IDF Report].[Number of caseweighted discharges]) AS Expr1, AVG(wies2.[0607_cwd_WIES11]) AS Expr2,
AdmissionMappingTable.Admission, wies2.Admission_type
FROM DomicileCodes
In the above query, I need to multiply "0607_cwd_WIES11" with the no. of months
Lets say if the user is being prompted to enter the no of months and he enters 3, then "0607_cwd_WIES11" should be multiplied by 3 and divided by 12.
Do i have to use stored procedures(which I have got no knowledge of)
What do I have to do??
Pls help
Thanks
Mita
View 5 Replies
View Related
Oct 19, 2006
I would like to set up a prompt / filter as part of the model that carries through to the report builder. I have a query where I would like to force a prompt on the user as part of any report they create. Ideally, I would like to have it default as well.
I noticed that there is a prompt attribute in model designer. When I go to add the filter attribute in model designer, I get the same dialog box I get in the report builder - except it does not have the prompt as an option. Is there a way to accomplish this?
Thanks
View 3 Replies
View Related
Jan 24, 2008
Hello everyone,
I have a request to hide certain parameters in a report based on the current user logged into our web based report viewer using the ReportViewer control fo asp.net.
I am doing the standard stuff required to display the report as shown below.
Code Snippet
rptViewer.ServerReport.ReportServerUrl = new Uri("http://172.17.144.26/ReportServer"); // new Uri(MINETSecurity.WebSettings.WebServerPath, UriKind.Absolute);
rptViewer.ServerReport.ReportPath = ReportName;
rptViewer.ServerReport.DisplayName = "Report1";
rptViewer.ServerReport.ReportServerCredentials = new CustomReportCredentials("myUsername", "myPassword", "myDomain");
Now that i have loaded the report into the viewer i illiterate through the report parameters looking for the ones which the specified user should not see as show below.
Code Snippet
ReportParameterInfoCollection MyReportParams = rptViewer.ServerReport.GetParameters();
foreach (ReportParameterInfo MyParameter in MyReportParams)
{
// returns a value from a custom class which is a predefined value for this user based on the current user logged into the website
string Value = CustomParameterValues.ToString(GlobalUserSettings.CurrentUser.CustomValueList);
if(Value != "") MyParameter.PromptUser = false;
}
Here is where the promblem lies, when i try to set the value of PromptUser i get the following compiler error.
Property or indexer 'Microsoft.Reporting.WebForms.ReportParameterInfo.PromptUser' cannot be assigned to -- its is read only
Is there anything i can do to set certain parameters invisible to the user and set there value myself. I know i could create 2 seperate reports and set the PromptUser value in the designer but i dont really want to be duplicating reports just to hide or show parameters.
I have tried using the SetParameters method of the ReportViewer component to pass the value of the parameters that should be hidden and even set the visible property to false, but it dosn't seem to work.
Any help here would be appreciated.
Cheers
Scott Blood
View 8 Replies
View Related
Oct 15, 2007
Hi,
Suppose I have two prompts, say A and B.
These two prompts are populated by using database queries.
B is dependent on A.
These prompts are multiselect.
I have noticed that it is not possible to deselect them once a value(s) are selected.
If I deselect all in A. They automatically get selected again.
They work fine as long as some value selected.
It is possible however to deselect all in B.
Thanks in advance.
View 6 Replies
View Related
Jan 15, 2005
Hi
Is there any why to Create SQL Server Objects from Command Prompts like (Databases , Tables, Stored Procedures, …) ??
If you will Install some Applications Like this forums you will see the SQL Server object Created from Command Prompts
How Can I do that .. ??
And thanks with my regarding
Fraas
View 1 Replies
View Related
Jan 5, 2008
I am running a report which takes a long time to render. It has 500K rows in it that need to be summed and grouped. After 5 minutes IE prompts for a password. I set the report time out to 15 min just to see if it would make a difference. I even set the IIS timeout to an to 15 min as well.
I know that its bad to run a report this big, but I'm just curious why it prompts for a password. In case a user runs the report. Report uses dates so its possible they could go way back and not realize its 500K rows. I am assuming it is an IE issue with the browser and found a registry edit, but I don't really want to edit registries on my users' computers.
View 1 Replies
View Related
Sep 27, 2007
hye everyone,
i have Problem for the prompts will display at the top of the report in the browser :
1)go to the report manager on computer and set the
set the Prompt User check boxes to checked.
--> auto check
2)select the report viewer control, if you are using it, and set the Parameters property to false.
--> the eror mesage will be display
" The ' field " parameter is missing value. "
what should i do...any idea
thanks in advance
thank you very much
View 1 Replies
View Related
Sep 16, 2004
Hello -
I dont know something weired happened on our MSSQL server today. We are able to connect to any Databases from Enterprise Manager from a Remote server.
Once we logged in and connected to a database on my database server, it keep prompting for the user id and password as we browsing through different tables in that database?
(Right click on the table then select Open Table -> Return all rows -> and it prompts for password )
Now when we enter password the contents of Table are displayed and now when we try to see contents of another table in the database it again prompts for password.
Any Idea whats wrong? How this can be resolved as it was not happening before .. :(
View 1 Replies
View Related
Apr 9, 2008
I know I can do a JOIN(parameter, "some seperator") and it will build me a list/string of all the values in the multiselect parameter.
However, I want to do the same thing with all the occurances of a field in my result set (each row being an occurance).
For example say I have a form that is being printed which will pull in all the medications a patient is currently listed as having perscriptions for. I want to return all those values (say 8) and display them on a single line (or wrap onto additional lines as needed).
Something like:
List of current perscriptions: Allegra, Allegra-D, Clariton, Nasalcort, Sudafed, Zantac
How can I accomplish this?
I was playing with the list box, but that only lets me repeat on a new line, I couldn't find any way to get it to repeate side by side (repeat left to right instead of top to bottom). I played with the orientation options, but that really just lets me adjust how multiple columns are displayed as best I can tell.
Could a custom function of some sort be written to take all the values and spit them out one by one into a comma seperated string?
View 21 Replies
View Related
Jan 28, 2008
I have just started using SQL Server reporting services and am stuck with creating subreports.
I have a added a sub report to the main report. When I right click on the sub report, go to properties -> Parameters, and click on the dropdown for Parameter Value, I see all Sum and Count fields but not the data fields.
For example, In the dropdownlist for the Parameter value, I see Sum(Fields!TASK_ID.Value, "AppTest"), Count(Fields!TASK_NAME.Value, "CammpTest") but not Fields!TASK_NAME.Value, Fields!TASK_ID.Value which are the fields retrieved from the dataset assigned to the subreport.
When I manually change the parameter value to Fields!TASK_ID.Value, and try to preview the report, I get Error: Subreport could not be shown. I have no idea what the underlying issue is but am guessing that it's because the field - Fields!TASK_ID.Value is not in the dropdown but am trying to link the main report and sub report with this field.
Am I missing something here? Any help is appreciated.
Thanks,
Sirisha
View 3 Replies
View Related
Feb 20, 2008
How can I create a Table whose one field will be 'tableid INT IDENTITY(1,1)' and other fields will be the fields from the table "ashu".
can this be possible in SQL Server without explicitly writing the"ashu" table's fields name.
View 8 Replies
View Related
Jan 26, 2008
sir
I have got this error message to establish connction with recordset vb .net, Can you please rectify this
Too many arguments to 'Public Overridable ReadOnly Default Property Fields() As ADODB.Fields'
my code like this
rs = New ADODB.Recordset
rs.Open("Select * from UserLogin where userid='" & txtUserName.Text & "'", gstrDB, DB.CursorTypeEnum.adOpenStatic)
If txtUserName.Text = rs.Fields.Append(userid) Then
MsgBox("OK", MsgBoxStyle.OKOnly, "Confirmation")
End If
thanks
View 1 Replies
View Related
Jul 23, 2005
Hello !I'm trying to update one table field with another table searched firstdate record.getting some problem.If anyone have experience similar thing or have any idea about it,please guide.Sample case is given below.Thanks in adv.T.S.Negi--Sample caseDROP TABLE TEST1DROP TABLE TEST2CREATE TABLE TEST1(CUST_CD VARCHAR(10),BOOKING_DATE DATETIME,BOOKPHONE_NO VARCHAR(10))CREATE TABLE TEST2(CUST_CD VARCHAR(10),ENTRY_DATE DATETIME,FIRSTPHONE_NO VARCHAR(10))DELETE FROM TEST1INSERT INTO TEST1 VALUES('C1',GETDATE()+5,'11111111')INSERT INTO TEST1 VALUES('C1',GETDATE()+10,'22222222')INSERT INTO TEST1 VALUES('C1',GETDATE()+15,'44444444')INSERT INTO TEST1 VALUES('C1',GETDATE()+16,'33333333')DELETE FROM TEST2INSERT INTO TEST2 VALUES('C1',GETDATE(),'')INSERT INTO TEST2 VALUES('C1',GETDATE()+2,'')INSERT INTO TEST2 VALUES('C1',GETDATE()+11,'')INSERT INTO TEST2 VALUES('C1',GETDATE()+12,'')--SELECT * FROM TEST1--SELECT * FROM TEST2/*Sample dataTEST1CUST_CD BOOKING_DATE BOOKPHONE_NOC12005-04-08 21:46:47.78011111111C12005-04-13 21:46:47.78022222222C12005-04-18 21:46:47.78044444444C12005-04-19 21:46:47.78033333333TEST2CUST_CD ENTRY_DATE FIRSTPHONE_NOC12005-04-03 21:46:47.800C12005-04-05 21:46:47.800C12005-04-14 21:46:47.800C12005-04-15 21:46:47.800DESIRED RESULTCUST_CD ENTRY_DATE FIRSTPHONE_NOC12005-04-03 21:46:47.80011111111C12005-04-05 21:46:47.80011111111C12005-04-14 21:46:47.80044444444C12005-04-15 21:46:47.80044444444*/
View 3 Replies
View Related
Jul 2, 2015
I am using MS SQL 2012. I have a table that contains all the data that I need, but I need to summarize the data and also add up decimal fields while at it. Then I need a total of those added decimal fields. My data is like this:
I have Providers, a unique ID that Providers will have multiples of, and then decimal fields. Here are my fields:
ID, provider_name, uniq_id, total_spent, total_earned
Here is sample data:
1, Harbor, A07B8, 500.00, 1200.00
2, Harbor, A07B8, 400.00, 800.00
3, Harbor, B01C8, 600.00, 700.00
4, Harbor, B01C8, 300.00, 1100,00
5, LifeLine, L01D8, 700.00, 1300.00
6, LifeLine, L01D8, 200.00, 800.00
I need the results to be just 3 lines:
Harbor, A07B8, 900.00, 2000.00
Harbor, B01C8, 900.00, 1800.00
LifeLine, L01D8, 900.00, 2100.00
But then I would need the totals for the Provider, so:
Harbor, 1800.00, 3800.00
View 3 Replies
View Related
Jul 20, 2005
I would like to search a table for a phrase, or for a partial phrase,eg on table product - for name or description, or name + descprition.How does one say select * from product where name + description like%phrase%or contains phraseCurrently I can get where name, or where descriotion like %phrase%,eg, where name like krups, or where description like coffee makerBut if I search for where name like %krups coffee maker% i get noresults. krups is in the name field, coffee maker is in thedescription field.Thanks,-M
View 1 Replies
View Related
Jun 30, 2000
Pardon me if this question is too elementary. I am trying to create a trigger that will cause certain datafields to be updated with values from other data fields in the same row when a certain column, created specifically to fire the trigger, is updated. The purpose of this is to reduce data entry by field personnel.I think I have the create trigger statement correct, but I'm a little confused on the update statement.
In a nutshell, how can I write something like:
UPDATE "TABLENAME"
SET DATAFIELD1 = DATAFIELD2
WHERE RECORDNUMBER = (THE SAME RECORD NUMBER)
I do know that I have to ensure that sp_dboption Recursive Triggers value is set to false, thanks.
View 2 Replies
View Related
Jul 31, 2013
I have a list of items in one table and a field (pageName) in another table that may contain one of the aforementioned items somewhere within that field. There is no fixed position within the field where the itemNo may be so I can't just use SUBSTRING(pageName,2,5) in(select itemNo from tblItem).
Logically, it's like I need to combine IN and LIKE: select pageName where pageName LIKE IN %select itemNo from tblitemNo%..LIKE can only handle one comparison string.
View 5 Replies
View Related
Mar 12, 2008
Hi all,
From the "How to Call a Parameterized Stored Procedure by Using ADO.NET and Visual Basic.NET" in http://support.microsft.com/kb/308049, I copied the following code to a project "pubsTestProc1.vb" of my VB 2005 Express Windows Application:
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.SqlDbType
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim PubsConn As SqlConnection = New SqlConnection("Data Source=.SQLEXPRESS;integrated security=sspi;" & "initial Catalog=pubs;")
Dim testCMD As SqlCommand = New SqlCommand("TestProcedure", PubsConn)
testCMD.CommandType = CommandType.StoredProcedure
Dim RetValue As SqlParameter = testCMD.Parameters.Add("RetValue", SqlDbType.Int)
RetValue.Direction = ParameterDirection.ReturnValue
Dim auIDIN As SqlParameter = testCMD.Parameters.Add("@au_idIN", SqlDbType.VarChar, 11)
auIDIN.Direction = ParameterDirection.Input
Dim NumTitles As SqlParameter = testCMD.Parameters.Add("@numtitlesout", SqlDbType.Int)
NumTitles.Direction = ParameterDirection.Output
auIDIN.Value = "213-46-8915"
PubsConn.Open()
Dim myReader As SqlDataReader = testCMD.ExecuteReader()
Console.WriteLine("Book Titles for this Author:")
Do While myReader.Read
Console.WriteLine("{0}", myReader.GetString(2))
Loop
myReader.Close()
Console.WriteLine("Return Value: " & (RetValue.Value))
Console.WriteLine("Number of Records: " & (NumTitles.Value))
End Sub
End Class
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
The original article uses the code statements in pink for the Console Applcation of VB.NET. I do not know how to print out the output of ("Book Titles for this Author:"), ("{0}", myReader.GetString(2)), ("Return Value: " & (RetValue.Value)) and ("Number of Records: " & (NumTitles.Value)) in the Windows Application Form1 of my VB 2005 Express. Please help and advise.
Thanks in advance,
Scott Chang
View 29 Replies
View Related
Oct 29, 2013
I have a SSRS report with four parameters,and I want to be able to enter information for two of the parameters and run the report opposed to all four of them. However, when I select allow blanks and only select the parameters that I want to run the report by, the report come back blank..Essentially, I want to be able to the run report by different parameters without having to enter information for all parameters at the same time.
View 2 Replies
View Related
Jan 21, 2008
Hi people
My users are having troubles with link to default drillthrough report when reports are exported to excel (they REALLY don't like this behavior ), so I decided set all of them disabled in report model, this work fine, but calculated field in reports has this drillthrough link.
Let me show you the situation. Entity Product has an UnitaryCost field, I set the EnableDrillthrough Property in False so when I export a report with this field, no link is shown.
But if I create in the report a calculated field Round(UnitaryCost) this field has a Drillthrough Link
Is this the standard and expected behavior? or its simply a BUG?
Have I done something wrong in my model? and in this case, How I can correct this?
regards.
Julio Diaz.
View 1 Replies
View Related
Apr 27, 2006
Hi,
I have an app in C# that executes a query using SQLCommand and parameters and is taking too much time to execute.
I open a SQLProfiler and this is what I have :
exec sp_executesql N' SELECT TranDateTime ... WHERE CustomerId = @CustomerId',
N'@CustomerId nvarchar(4000)', @CustomerId = N'11111
I ran the same query directly from Query Analyzer and take the same amount of time to execute (about 8 seconds)
I decided to take the parameters out and concatenate the value and it takes less than 2 second to execute.
Here it comes the first question...
Why does using parameters takes way too much time more than not using parameters?
Then, I decided to move the query to a Stored Procedure and it executes in a snap too.
The only problem I have using a SP is that the query can receive more than 1 parameter and up to 5 parameters, which is easy to build in the application but not in the SP
I usually do it something like
(@CustomerId is null or CustomerId = @CustomerId) but it generate a table scan and with a table with a few mills of records is not a good idea to have such scan.
Is there a way to handle "dynamic parameters" in a efficient way???
View 1 Replies
View Related
Mar 7, 2007
Hello:
I just recently bumped into this problem and I think I know what's causing it. This is the setup:
Report Parameters: FromDate, ToDate, DivisionalOffice, Manager, SalesRep
dsCalendarEvents Parameters: FromDate.Value, ToDate.Value, DivisionalOffice.Value,
dsDivisions Parameters: N/A
dsManager Parameters: DivisionalOffice.Value
dsSalesRep: DivisionalOffice.Label
When I query the ReportServices WS and scan the parameter dependencies for SalesRep it says there are four dependencies: FromDate, ToDate, DivisionalOffice and Manager!!!
If I change "dsSalesRep" to use "DivisionalOffice.Value" the ReportingServices WS parameter dependency scan returns only one dependency for "SalesRep" parameter!!!( This is the correct behavior )
Has anybody seen this behavior and more importantly, is there a work around?
Regards,
View 3 Replies
View Related
Jan 2, 2008
Hello all,
Given:
string commandText = "Categories_Delete";SqlCommand myCommand = new SqlCommand(commandText, connection);myCommand.CommandType = CommandType.StoredProcedure;
Is there a reason NOT to use myCommand.Parameters.AddWithValue("@CategoryID",CategoryID); I'd prefer to use that over myCommand.Parameters.Add("@CategoryID", SqlDbType.Int, 4).Value = CategoryID; as I have these functions being created dynamically and hope to get away from a big lookup to try to convert System.Types into SqlDbTypes. [shudder]
It seems that ADO.NET makes an implicit conversion to the valid type. If this is correct then I can move on fat dumb and happy. Anyone have any good insight?
Thanks,
View 11 Replies
View Related
Aug 8, 2007
What is the command to see how many lines were returned with a Select statement?
View 1 Replies
View Related
Oct 11, 1999
what is the max number of fields allowed in a table in sql server 7.0?
thanks
View 1 Replies
View Related