Building on the thread http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2205669&SiteID=1 which Jessica Moss posted the code below:
Code Block
select u.UserName, c.Path, r.RoleName
from ReportServer.dbo.PolicyUserRole pur
left join ReportServer.dbo.Users u on pur.userID=u.userID
left join ReportServer.dbo.Roles r on pur.roleID=r.roleID
left join ReportServer.dbo.Catalog c on pur.policyID=c.policyID
order by u.UserName, c.Path, r.RoleName
I tried to take it one step further and add a parameter where I could just type in the users Active Directory login id, thus limiting the result set. I also wanted to avoid having to type in the domainnameuserid for each parameter and only wanted to type the userid. So I changed the code (see below) and added a multi-value parameter called users.
Code Block
select u.UserName, c.Path, r.RoleName
from ReportServer$SQL2005DSS.dbo.PolicyUserRole pur
left join ReportServer$SQL2005DSS.dbo.Users u on pur.userID=u.userID
left join ReportServer$SQL2005DSS.dbo.Roles r on pur.roleID=r.roleID
left join ReportServer$SQL2005DSS.dbo.Catalog c on pur.policyID=c.policyID
where u.Username IN('DOMAINNAME' + @Users)
order by u.UserName, c.Path, r.RoleName
Unfortunately, if I type:
Domainnamejblack
Domainnamejdoe
Domainnameefranks
I only get a return for the first userid entered. Any ideas?
1. Does SSRS is J-Sox Compliant, an application must have audit trail feature. For Reporting printing, it should facilitate reports' data logging process.
2. Information like WHO and WHEN printed the report and WHAT data was viewed?
I'm trying to create and Audit report for different tables.I'd like to use an generic table structure for the report which will be temp.I was thinking something like this:
I've already created the audit table with same structure plus all field duplicated and action type. (this was a request)Now I need to group it for the report.following an example of audit table I've created
tblTest_audit ( ID ID_new Name Name_new Address Address_new )
I need to be able to run a SECURITY audit/report against my Report Servers. I want to be able to see which users have which rights in which folders, etc.
I cannot find any canned report for this (from MS or on Web) I cannot find data in ReportServer dbase that I can read.
I am trying to create a TSQL statement or stored procedure that cantell me what users belong to what group and what groups have access towhat files. Can anyone help? Can I pull out a list of names fromActive Directory to use as my user list?
I have made a server security audit and specify from database audit specification to audit "select" on a certain user and on a certain table. I logged in by this user and made the select statement..when i run this query
"select * from sys.fn_get_audit_file('d:Auditaudit1*',null,null)"
It return a value at which time the query has done
after 15 minutes i repeated the same action, i run the audit query and the same result is showed off on the panel.is it suppose to return a list of values by how many times this user has made the select statement on that table ? for example at 5:00 pm then 6:00 pm and so on
I need help...here is the problem.Last weekend, the servers in our datacenter where moved around. After thismove, and maybe coincidental, 1 server is performing very poor. Afterrunning a trace with SQL Profiler, I saw the problem which was laterconfirmed with another tool for SQL server performance monitoring. It seemsthat all connections to the SQL server (between 200 - 400) are doing a login/ logout for each command that they process. For example, the user'sconnection will login, perform a SELECT, and then logout. This is not a..NET application. The client software was not changed, it is still thesame. The vendor has said that it is not supposed to do that, it issupposed to use 1 connection that log's on in the morning and logs off atthe end of the day or whenever the user exits. 1 user may have severalconnections to the database.At times, the server is processing over 250 login / logouts (avgeraged for30 second period). Has anyone seen this problem? I have the server inAUDIT FAILUREs only. The server has become very unresponsive, things thattook 3 seconds now take over 15 seconds.Any ideas???
I have searched the archive of this forum, and based on some previous answers have read the followin FAQ
http://www.gotreportviewer.com/
However, even so, I still have a questoin about when to use RDLC vs RDL from the point of view of licensing and load sharing betwee DB and report server.
1. As we all know that SSRS will take a license of SQL Server if the web service is deployed on any other machine other than SQL Server (which is normally the case because no serious DBA will allow IIS apps to be installed on the DB Server). Also, if the SSRS is deployed on NLB cluster then each node of the cluster would need a "SQL Enterprise" license. (which can be very expensive).
2. Co deploying the SSRS with SQL Server is a bad idea because it puts excessive load on the DB+Report Server.
3. Since there is no "load balancing" in SQL all the rendering has to be done by the SSRS service which is running on the DB Server.
Now compare this to RDLC
1. RDLC gives me the same engine as RDL
2. However it has no licensing tags to it.
3. I can deploy ASP.NET report viewer on my web farm and scale it out as much as I like.
4. Extract data from the DB using stored procedures.
So it seems that RDLC solution is cheaper, gives better scale out capabilities and also moves the rendering of reports on the web farm rather than the Report Server.
Why should me or anyone else choose RDL at all?
There seems to be one disadvantage that the data has to fetched programmatically and manually binded (like an ASP.NET app) as RDLC does not provide any feature to connect to data sources. But this is not much when you see the cost and scalability benefits.
I am new to this but here goes. I have a sqlserver with asp.net.I have a stored procedure in the database named Try_Login .I need to know how and what is the best way to accomplish my task.I need the data in the stored procedure after it runs.Do I use the ExecuteReader() Method or how do I go about retrieving these values?????
CREATE procedure dbo.Try_Login ( @LoginName nvarchar(15), @Password NvarChar(15) ) as select UserName, UserPassword, UserClinic, UserTester from Clinic_users where UserName = @LoginName and UserPassword = @Password
What I need to know is how to get my code to correspond with it.I.E. I have a login in form... txtUsername and txtPassword need to be passed to this Stored procedure. I assume you use .value to obtain thier values.Here is my code so far......
Public Sub LoginDB() Dim conLogin As SqlConnection Dim cmdLogin As SqlCommand Dim dtrLogin As SqlDataReader conLogin = New SqlConnection ("Server=myserver;database=APPOINTMENTS;uid=XXXX;pwd=XXXX") cmdLogin = New SqlCommand("Try_Login ", conLogin) cmdLogin.CommandType = CommandType.StoredProcedure cmdLogin.Parameters.Add("@LoginName",txtUsername.Text) cmdLogin.Parameters.Add("@Password",txtPassword.Text)
I'm not getting it. The query below "e.g." is exactly as I think it should be except for the <Join Clause> as there is only the match on site name. I tried joing on the site name, but only got the sites in the log. I want all the site names even if they don't have a log item for a given date range.
I'd post my real query if it would help, it's just that I'm chopping up some strings and converting some time stamps to dates as varchar for readability for the final report, which is an MSExcel pivot table.
My original post lies below.
TIA
jEfFp...
Reply... Date: Basic Query Help (reply) RickD (Rick.Davis@Schroders.com) 7/11/01 6:41:26 AM
Make log an outer join to site.
e.g
select s.name, l.ondate from site s RIGHT OUTER JOIN log l ON <Join Clause> where substring(id,3,6) in(select name from site) and ondate between getdate()-8 and getdate()-1
You didn't seem to have any logical join between the tables, but i'm sure you have, just put this in the <Join Clause>.
Oh, and read BoL, it helps no end.....
------------ Original Post... Jeff Proctor at 7/10/01 11:18:31 PM
my 7 day query....
select s.name, l.ondate from site s, log l where substring(id,3,6) in(select name from site) and ondate between getdate()-8 and getdate()-1
This returns those sites that exist in the current log, however what I want is a result set that has a row for each name regardless if they are in the log.
I have 2 tables...
table1 sites name smithj anandt burtot proctj etc....
I keep getting this error when tring to log in to a SQL 7 db from a client application written in VB6.
The text reads:
Login failed for user 'rmuser'. Reason: Not associated with a trusted SQL Server connection.
I have the account setup in SQL security and I have the account listed in the database and I'm using named pipes on a common domain. I'm running out of options. The network is a mix of Novell and NT. Please help
I have done the following and a domain user would not access report created a login to the SQL server to the user (this SQL Server is where data source DB is)went to site setting in Report Manager and made this use a system userright clicked on report folder and made this user in the browser roleeven checked that in the report in question, the user is already in the browser role Still the user would not access the report! "User .......... does not have required permission" is the error message I am getting.
I have written a report visual studio. The report has 10 multi-value parameters that pull data from their individual data sets within the reports. When running the report from within Visual Studio it renders fine. There are no errors reported, only a warning related to a pathname I have use to retrieve image data and display on the report.Deployment of the report is error free.When I view the report I briefly get the "Loading" splash window, but then nothing. None of the headers or static text is displayed. The results window is blank.
The report defaults all the parameter values. In trying to debug the issue I have found by reducing the number of parameter values the report will render. Once I have all the values added, the report does nothing.Below is the query being used for the report. The where clause in the query shows the parameters being used and the syntax.We are running on Windows Server 2008 R2 and SQL Server 2008 R2.
Ralph SELECT RTRIM(a.ITEMNMBR) AS Style, RTRIM(a.ITEMDESC) AS Description, a.ITMSHNAM AS UPC, c.LOCNCODE AS Store, d.LISTPRCE AS ListPrice, a.CURRCOST AS Cost, a.USCATVLS_1 AS [Main Category], a.USCATVLS_2 AS Market, a.USCATVLS_3 AS [Alternate Retail], a.USCATVLS_4 AS Country, b.ITEMXTRAS_1_Type AS Type, b.ITEMXTRAS_2_Finish AS Finish, b.ITEMXTRAS_3_SubCategory AS SubCategory, b.ITEMXTRAS_4_Department AS Department,
I have a ssrs report having 2 tables in with 4 columns in each. When I go to export option in preview I can see all data coming in one excel sheet, But I am trying to get 2 tables in 2 different pages in Excel when I export.First page of excel comes with first table data with 4 columns and second page of excel comes with second table data with 4 columns .
We have an Office SharePoint 2007 site, we developed a couple of web parts and added them to our site. We used SQL Server Reporting services 2005 as our reporting solution. The reports are hosted on the report center and when we need a report, we open it by sending a URL requesting the report, passing the report parameters in the URL query string. So the report is filtered based on the parameters passed from the web parts.
But since best practices say that you should host reports directly under SharePoint, by configuring the reporting services to run in the SharePoint integrated mode. We followed the steps and installed SharePointRS and we finally succeeded to publish the reports to a SharePoint folder, but we had a limitation: we are unable to pass the report parameters internally to the report hosted in SharePoint. If we passed them in the query string as the report center case, SharePoint neglects them totally. So the question is: how can I pass parameters internally between a SharePoint web part and a SQL server 2005 reporting services report hosted in SharePoint?
I'm wondering how to print a SSRS report without bringing up a report viewer. Is there way to print(PDF format) the SSRS report in the web application( .net ) directly from the "print" button without bringing up a report viewer?
I'm encounter lately some weird behaviour of SSRS in BIDS as well as after deploying on Reporting Server. I'm running basic classical SQL SSRS Reports with Oracle DB connection. My reports have header and footer pagination and well defined report layer configuration. All the reports are simple based on one table and some basic parameters passed to query.
In query builder from BIDS from data tab, the query is running fine without any other execution delays. Also the query is runnign fine in PL/Dev environment. When I switch in "Preview" mode the report hangs in execution and just showing "Report is being generated" without any resuts. After a while is generating an execution error (after 20 min).
The behaviour is the same after deployment on Report Server . I now...here it comes...the problem is intermitent...some times the report is working...but most of the times it hangs on execution. I checked the report from top to bottom and nothing's wrong from design perspective.
On other reports I don't have this problem and I don't understand where to start to investigate.
I am trying to develop a report from cube,and it has one drill through report.when i click on sales amount field on main report,then it open the drill through report with details.Here i passed the **(category,subcat,product)parameters(Cascaded)** to drill through report in action part of main report.In my main report i have two columns .
when i click on 100, parameters are passed & it open the detail report correctly, but when i click on 50,the values for subcat parameter is not getting values in detail report and same as the product also.
How do I get data on my linked report based on my grouped subtotal and grand total from the main report. The subtotal and grand total are calculated columns.
I have a 3 columns in my matrix in the SSRS summary report. Actn_COAST, ActnCITY and NumbOfAccts.
The following is code for my summary report. The results are shown below.
SELECT Distinct ActnCITY, Count(ACCT) as NumbOfAccts, CASE WHEN ActnCITY in ('NY', 'OH', IN, 'NJ', 'SC', 'NC') THEN 'EAST COAST' WHEN ActnCITY IN ('CA'. 'NV', 'UT', 'WA', 'OR') THEN 'WEST COAST' ELSE 'OTHER' END AS Actn_COAST
FROM tbl1 where ACTNDATE between @STARTDT and @EndDT
Code for my detail report contains the following SQL
SELECT * FROM tbl1 where ACTNDATE between @STARTDT and @EndDT AND @ActnCITY = ActnCITY
I have linked my report based on the NumbOfAccts column. I am able to get data if I click any of the NumbOfAccts values related to the state I want. However when I am not sure how to make the subtotal and grand total work. I want when I click on the subtotal of either coast, I should be able to see records of that coast e.g., if I select 37 I should be able to see all the records in East Coast. If I click on the Grand Total, I only want data related to those 2 coasts.
Is there a way to subscribe SSRS report using dynamic parameters for email and trigger the report from autosys job so that report should generate the exact time the job is triggered.Let me describe, my SSRS report should be triggered on success of one autosys job. i need to send email parameter and time of report schedule from this autosys job.
Hi, I'm having problems navigating from one report to another one if the second report has a multi-valued report parameter. When I navigate to the second report, I don't pass any parameters, but I get an error "parameter is missing a value" for the multi-valued report parameter. I have it setup as allow "multi-value" and "blank value". Any idea what the issue might be? Thanks.
How to display the logo in middle of report header , The logo is embedded in the Image folder . The column of the report are static. we are using SSRS 2008
I have a report which works fine with visual studio but when i uploaded the same into report server and tries to access it through IE or chrome or anything its dam slow.
I need to create a SSRS report using the Warehouse tfs_warehouse DB Report need to be drill down on WorkItemType Parents and child values. So, If we click on Product Back Log Item will get all the tasks inside it and so on....
------->Product BackLog items ----------> Bugs Or Tasks -----------> Tasks
I have done research and found out how to do it in OLAP cube ..but still can't figure out the TSQL query to be used.Found one of the query on forum:
SELECT * FROM DimWorkItem DWI INNER JOIN FactWorkItemLinkHistory FWILH ON DWI.System_Id = FWILH.TargetWorkItemID WHERE FWILH.WorkItemLinkTypeSK IN (SELECT DWILT.WorkItemLinkTypeSK FROM DimWorkItemLinkType DWILT WHERE DWILT.LinkName = N'Child') AND DWI.System_WorkItemType = N'Task' AND DWI.System_Rev = (SELECT MAX(DWI1.System_Rev) FROM DimWorkItem DWI1 WHERE DWI1.System_Id = DWI.System_Id) AND FWILH.SourceWorkItemID IN (SELECT DWI2.System_Id FROM DimWorkItem DWI2 WHERE DWI2.System_WorkItemType = N'Bug');
It appears to work fine on my end however on my clients end, whenever they try to print a report that displays perfectly within the report viewer to their printer by selecting the printer button in the report it never ends up printing.., however if they go into printer setup and change the page range to print from all pages to just maybe one page and then select the print button it seems to print fine..
The printer seems to receive the information as the light flashes but no page kick out when all pages is selected to print..
Hello, I'm using Reporting Services to render a text (stored in sql as varchar(max)). The text is all plain text, with some lines having trailing spaces.
Source text file i've imported to SQL via SSIS: CLIENT: 10055 STATEMENT 2007 DATE:1002993 THIS IS THE OTHER STATEMENT COLUMN1 COLUMN2 COLUMN 3 TRY THIS
*Note the trailing spaces on the line before 'STATEMENT 2007'.
I've designed a report using the Report Project in VS2005 to retrieve this text via a stored procedure. When I test the report using the 'Preview' tab in the IDE, it looks good CLIENT: 10055 STATEMENT 2007 DATE:1002993 THIS IS THE OTHER STATEMENT COLUMN1 COLUMN2 COLUMN 3 TRY THIS
But when I deploy the report and run it using URL Access:
CLIENT: 10055 STATEMENT 2007 DATE:1002993
THIS IS THE OTHER STATEMENT
COLUMN1 COLUMN2 COLUMN 3 TRY THIS
On all lines with trailing spaces, they (the trailing spaces) have been removed. This is affecting my formatting of some reports and statements. We really want to use the report viewer as it has built in paging, print and export capabilities.
Why does it look okay in VS2005 but different in Report Viewer via URL Access and Report Manager?
Note: When I export as PDF, it looks okay.
The stored procedure I use to return the data is a CLR Hosted assembly as below:
Code Snippet Partial Public Class StoredProcedures <Microsoft.SqlServer.Server.SqlProcedure()> _
Public Shared Sub GetPagedDocument(ByVal inText As SqlString) Dim dr As SqlDataReader Dim row As New SqlDataRecord(New SqlMetaData("RowText", SqlDbType.Text)) Dim cmd As New SqlCommand("select cast(doc as varchar(max)) as 'DOCTEXT' from testdoc WHERE id='" + inText + "'") Dim cn As New SqlConnection("context connection=true") cn.Open() cmd.Connection = cn SqlContext.Pipe.SendResultsStart(row) 'initialise the resultset to be returned dr = cmd.ExecuteReader 'If no records in result set, return. If Not dr.HasRows Then
row.SetString(0, "There is no document to display or you do not have permission to view the document.") SqlContext.Pipe.SendResultsRow(row) SqlContext.Pipe.SendResultsEnd() ' SqlContext.Pipe.Send("There is no document to display.") Return End If 'Read rows in the result set dr.Read()
'Get the entire text Dim docText As String = dr.Item("DOCTEXT") 'debug row.SetString(0, docText) SqlContext.Pipe.SendResultsRow(row) SqlContext.Pipe.SendResultsEnd() Return 'end debug
I have a database with a date of birth. From this, I need to select records that include a large number of variables including records where an individual is older than a selected age and/or younger than a selected age, and even worse, of a given astrological sign if one is selected. I'm currently using a strongly typed dataset. Is this something that's do-able with a dataset, or should I build the select string on the form programmatically? I have an ASP site that I'm re-writing in ASP.NET 2.0. In the ASP site the select string includes the code below. I just don't see how I can do this in a dataset.if (strLowerAge <> 18) or (strUpperAge <> 99) then If (strLowerAge <> "") Then strSQL = "SELECT [DATE OF BIRTH], [FIRST NAME], [LAST NAME], [STATE], [MALE OR FEMALE] FROM members WHERE (DateDiff(yyyy, [DATE OF BIRTH], '" & date & "') >= " & strLowerAge & ")" End If If (strUpperAge <> "") Then If (strSQL <> "") Then strSQL = strSQL & " AND (DateDiff(yyyy, [DATE OF BIRTH], '" & date & "') <= " & strUpperAge & ")" Else strSQL = "SELECT [DATE OF BIRTH], [FIRST NAME], [LAST NAME], [STATE], [MALE OR FEMALE] FROM members WHERE (DateDiff(yyyy, [DATE OF BIRTH], '" & date & "') <= " & strUpperAge & ")" End If end if End If If (strAstSign <> "") Then Select Case strAstSign Case "Aries 3/21 - 4/19" If (strSQL <> "") Then strSQL = strSQL & " AND ((DATEPART(m,[DATE OF BIRTH]) = 3 AND DATEPART(d,[DATE OF BIRTH]) > 20 ) OR (DATEPART(m,[DATE OF BIRTH]) = 4 AND DATEPART(d,[DATE OF BIRTH]) < 20 ))" Else strSQL = "SELECT [DATE OF BIRTH], [FIRST NAME], [LAST NAME], [STATE], [MALE OR FEMALE] FROM members WHERE (DATEPART(m, [DATE OF BIRTH]) = 3 AND DATEPART(d, [DATE OF BIRTH]) > 20 ) OR (DATEPART(m, [DATE OF BIRTH]) = 4 AND DATEPART(d, [DATE OF BIRTH]) < 20 )" End If Case "Taurus 4/20 - 5/20" If (strSQL <> "") Then strSQL = strSQL & " AND ((DATEPART(m,[DATE OF BIRTH]) = 4 AND DATEPART(d,[DATE OF BIRTH]) > 19 ) OR (DATEPART(m,[DATE OF BIRTH]) = 5 AND DATEPART(d,[DATE OF BIRTH]) < 21 ))" Else strSQL = "SELECT [DATE OF BIRTH], [FIRST NAME], [LAST NAME], [STATE], [MALE OR FEMALE] FROM members WHERE (DATEPART(m,[DATE OF BIRTH]) = 4 AND DATEPART(d,[DATE OF BIRTH]) > 19 ) OR (DATEPART(m,[DATE OF BIRTH]) = 5 AND DATEPART(d,[DATE OF BIRTH]) < 21 )" End If Case "Gemini 5/21 - 6/20" If (strSQL <> "") Then strSQL = strSQL & " AND ((DATEPART(m,[DATE OF BIRTH]) = 5 AND DATEPART(d,[DATE OF BIRTH]) > 20 ) OR (DATEPART(m,[DATE OF BIRTH]) = 6 AND DATEPART(d,[DATE OF BIRTH]) < 21 ))" Else strSQL = "SELECT [DATE OF BIRTH], [FIRST NAME], [LAST NAME], [STATE], [MALE OR FEMALE] FROM members WHERE (DATEPART(m,[DATE OF BIRTH]) = 5 AND DATEPART(d,[DATE OF BIRTH]) > 20 ) OR (DATEPART(m,[DATE OF BIRTH]) = 6 AND DATEPART(d,[DATE OF BIRTH]) < 21 )" End If Case "Cancer 6/21 - 7/22" If (strSQL <> "") Then strSQL = strSQL & " AND ((DATEPART(m,[DATE OF BIRTH]) = 6 AND DATEPART(d,[DATE OF BIRTH]) > 20 ) OR (DATEPART(m,[DATE OF BIRTH]) = 7 AND DATEPART(d,[DATE OF BIRTH]) < 23 ))" Else strSQL = "SELECT [DATE OF BIRTH], [FIRST NAME], [LAST NAME], [STATE], [MALE OR FEMALE] FROM members WHERE (DATEPART(m,[DATE OF BIRTH]) = 6 AND DATEPART(d,[DATE OF BIRTH]) > 20 ) OR (DATEPART(m,[DATE OF BIRTH]) = 7 AND DATEPART(d,[DATE OF BIRTH]) < 23 )" End If Case "Leo 7/23 - 8/22" If (strSQL <> "") Then strSQL = strSQL & " AND ((DATEPART(m,[DATE OF BIRTH]) = 7 AND DATEPART(d,[DATE OF BIRTH]) > 22 ) OR (DATEPART(m,[DATE OF BIRTH]) = 8 AND DATEPART(d,[DATE OF BIRTH]) < 23 ))" Else strSQL = "SELECT [DATE OF BIRTH], [FIRST NAME], [LAST NAME], [STATE], [MALE OR FEMALE] FROM members WHERE (DATEPART(m,[DATE OF BIRTH]) = 7 AND DATEPART(d,[DATE OF BIRTH]) > 22 ) OR (DATEPART(m,[DATE OF BIRTH]) = 8 AND DATEPART(d,[DATE OF BIRTH]) < 23 )" End If Case "Virgo 8/23 - 9/22" If (strSQL <> "") Then strSQL = strSQL & " AND ((DATEPART(m,[DATE OF BIRTH]) = 8 AND DATEPART(d,[DATE OF BIRTH]) > 22 ) OR (DATEPART(m,[DATE OF BIRTH]) = 9 AND DATEPART(d,[DATE OF BIRTH]) < 23 ))" Else strSQL = "SELECT [DATE OF BIRTH], [FIRST NAME], [LAST NAME], [STATE], [MALE OR FEMALE] FROM members WHERE (DATEPART(m,[DATE OF BIRTH]) = 8 AND DATEPART(d,[DATE OF BIRTH]) > 22 ) OR (DATEPART(m,[DATE OF BIRTH]) = 9 AND DATEPART(d,[DATE OF BIRTH]) < 23 )" End If Case "Libra 9/23 - 10/22" If (strSQL <> "") Then strSQL = strSQL & " AND ((DATEPART(m,[DATE OF BIRTH]) = 9 AND DATEPART(d,[DATE OF BIRTH]) > 22 ) OR (DATEPART(m,[DATE OF BIRTH]) = 10 AND DATEPART(d,[DATE OF BIRTH]) < 23 ))" Else strSQL = "SELECT [DATE OF BIRTH], [FIRST NAME], [LAST NAME], [STATE], [MALE OR FEMALE] FROM members WHERE (DATEPART(m,[DATE OF BIRTH]) = 9 AND DATEPART(d,[DATE OF BIRTH]) > 22 ) OR (DATEPART(m,[DATE OF BIRTH]) = 10 AND DATEPART(d,[DATE OF BIRTH]) < 23 )" End If Case "Scorpio 10/23 - 11/21" If (strSQL <> "") Then strSQL = strSQL & " AND ((DATEPART(m,[DATE OF BIRTH]) = 10 AND DATEPART(d,[DATE OF BIRTH]) > 22 ) OR (DATEPART(m,[DATE OF BIRTH]) = 11 AND DATEPART(d,[DATE OF BIRTH]) < 22 ))" Else strSQL = "SELECT [DATE OF BIRTH], [FIRST NAME], [LAST NAME], [STATE], [MALE OR FEMALE] FROM members WHERE (DATEPART(m,[DATE OF BIRTH]) = 10 AND DATEPART(d,[DATE OF BIRTH]) > 22 ) OR (DATEPART(m,[DATE OF BIRTH]) = 11 AND DATEPART(d,[DATE OF BIRTH]) < 22 )" End If Case "Sagittarius 11/22 - 12/21" If (strSQL <> "") Then strSQL = strSQL & " AND ((DATEPART(m,[DATE OF BIRTH]) = 11 AND DATEPART(d,[DATE OF BIRTH]) > 21 ) OR (DATEPART(m,[DATE OF BIRTH]) = 12 AND DATEPART(d,[DATE OF BIRTH]) < 22 ))" Else strSQL = "SELECT [DATE OF BIRTH], [FIRST NAME], [LAST NAME], [STATE], [MALE OR FEMALE] FROM members WHERE (DATEPART(m,[DATE OF BIRTH]) = 11 AND DATEPART(d,[DATE OF BIRTH]) > 21 ) OR (DATEPART(m,[DATE OF BIRTH]) = 12 AND DATEPART(d,[DATE OF BIRTH]) < 22 )" End If Case "Capricorn 12/22 - 1/19" If (strSQL <> "") Then strSQL = strSQL & " AND ((DATEPART(m,[DATE OF BIRTH]) = 12 AND DATEPART(d,[DATE OF BIRTH]) > 21 ) OR (DATEPART(m,[DATE OF BIRTH]) = 1 AND DATEPART(d,[DATE OF BIRTH]) < 20 ))" Else strSQL = "SELECT [DATE OF BIRTH], [FIRST NAME], [LAST NAME], [STATE], [MALE OR FEMALE] FROM members WHERE (DATEPART(m,[DATE OF BIRTH]) = 12 AND DATEPART(d,[DATE OF BIRTH]) > 21 ) OR (DATEPART(m,[DATE OF BIRTH]) = 1 AND DATEPART(d,[DATE OF BIRTH]) < 20 )" End If Case "Aquarius 1/20 - 2/18" If (strSQL <> "") Then strSQL = strSQL & " AND ((DATEPART(m,[DATE OF BIRTH]) = 1 AND DATEPART(d,[DATE OF BIRTH]) > 19 ) OR (DATEPART(m,[DATE OF BIRTH]) = 2 AND DATEPART(d,[DATE OF BIRTH]) < 19 ))" Else strSQL = "SELECT [DATE OF BIRTH], [FIRST NAME], [LAST NAME], [STATE], [MALE OR FEMALE] FROM members WHERE (DATEPART(m,[DATE OF BIRTH]) = 1 AND DATEPART(d,[DATE OF BIRTH]) > 19 ) OR (DATEPART(m,[DATE OF BIRTH]) = 2 AND DATEPART(d,[DATE OF BIRTH]) < 19 )" End If Case "Pisces 2/19 - 3/20" If (strSQL <> "") Then strSQL = strSQL & " AND ((DATEPART(m,[DATE OF BIRTH]) = 2 AND DATEPART(d,[DATE OF BIRTH]) > 18 ) OR (DATEPART(m,[DATE OF BIRTH]) = 3 AND DATEPART(d,[DATE OF BIRTH]) < 21 ))" Else strSQL = "SELECT [DATE OF BIRTH], [FIRST NAME], [LAST NAME], [STATE], [MALE OR FEMALE] FROM members WHERE (DATEPART(m,[DATE OF BIRTH]) = 2 AND DATEPART(d,[DATE OF BIRTH]) > 18 ) OR (DATEPART(m,[DATE OF BIRTH]) = 3 AND DATEPART(d,[DATE OF BIRTH]) < 21 )" End If End Select END IFDiane
Greetings. ASP.NET neophyte seeking a bit of advice. I am looking for the specific syntax that allows me to pass a local variable into an open query within SQL 2000 for a linked server, such as:
SELECT [ticketno] from OpenQuery(JWS_GR, 'select ticketno from tksmisc where itemno = 1 AND ticketno = @scaleticketno')
I included the variable @scaleticketno here where I was using an actual value. This doesn't work, returning the eqivalent of a database 'DUH?' message because the linked server database engine (Pervasive SQL 2000i) has no idea how to treat @scaleticketno. (Nor do I.) Any thoughts, suggestions or recommendations would be much appreciated and regarded with eternal gratitude.
i just clicked on Advanced mode in Column Group, and then in Row Group Side i set Fixed Data=true for first top static. I'm using local report not server report and i'm displaying that local report in Reportviewer. Now also its not working....