I'm not sure how to go about this and need some help.
I've got a data extract rather than a properly structure table in SQL.
It looks something like below:
Name: Item:
John Ball
John Racket
Paul Ball
Jim Glove
Jim Ball
What sort of script can I run that will return each name once and then
the Items in as many columns needed to list them all?
I.e. so that it will look like
Name: Item1 Item2
John Ball Racket
Paul Ball
Jim Glove Ball
I have a table with a row to display the count of all records with a specified specialty. The count is displaying the correct value, however the row is being displayed 20 times as there are 20 records.
I would like this row to only be displayed once. I'd appreciate being pointed in the right direction as to how to do this.
neo writes "hi i am a beginner at sql this query confuses me...
q:A LIST OF SERVICE TRANSACTIONS(WITH A FULL DESCRIPTION OF THE SERVICE) ON A PARTICULAR DAY ALONG WITH THE NAMES OF THE CUSTOMER AND THEIR ROOM NUMBERS.THE TOTAL AMOUNT TRANSACTED NEEDS TO BE DISPLAYED AT THE BOTTOM OF THE LIST
REQD TABLES ARE SERVICES,TRANSACTIONS AND RESERVATIONS...
all i can do was this answer...
SELECT T.TRANID,S.*,R.FNAME,R.LNAME,R.ROOMID FROM SERVICES AS S ,RESERVATIONS AS R,TRANSACTIONS AS T WHERE S.SERNO=T.SERNO AND T.CUSTID=R.CUSTID ORDER BY T.TRANID COMPUTE SUM(S.SERCHAR)
is there a better way to display in the same table the sum too?"
When I query this field it returns a value between 0-10 . In my report I need to display this as a text(example: "2006-2007" if 6 was returned). Currently I'm using a Switch function. I was wondering is there is an easier way to do this using a lookup table or something like that. Thanks..
Got a question here and as I am no expert programmer, this should be easy for you gurus. I have this fairly generic code I've created where I return data from an SQL table in a DataList control. I want to take it to the next level and return only the last record in the table, but I am unsure of how to do that. Perhaps I shouldn't even be using a DataList control, I'm not sure.
Hye Friends, I'm using a DMX query to get some predictions out of my MiningModel
my DMX query is as follows :
SELECT predict([x SalaryPredictor].[Emp Gross],20),predict([x SalaryPredictor].[Emp Basic],20) From [x SalaryPredictor]
This query is returning me 2 objects of type expressions in my Dataset. The problem is when I try to drag these 2 fields in my Table i get a "#Error" value
I executed the query in 'Data' tab and found that data is getting returned is a tree like format where "Expression" is at top & values expected ar its child nodes.
I also found out that the returned objects are actually AdomdDataReader , but i'm not able to write a expression to get its values in my tables....
I want to display the values in the following format....
I like to get data from a signle table and arranged in hierarchical(hierarchy) order. What will be my sql script to be able to get the desired result shown below? Please include some explanation as too what script is doing..
Table Structure and Sample Data
Id ParentId Name Code DisplayOrder 1 null Group 1 G00001 1 2 null Group 2 G00002 2 3 1 Sub-Group 1 SG0001 1 4 2 Sub-Group 2 SG0002 1 5 3 Sub-Sub-Group 1 SSG001 1 6 null Group 3 G00003 3 7 3 Sub-Sub-Group 2 SSG002 2
Desired Result Id ParentId Level Name ExtendedName DisplayOrder 1 null 1 Group 1 Group 1 1 3 1 2 Sub-Group 1 Group 1 -> Sub-Group 1 1 5 3 3 Sub-Sub-Group 1 Group 1 -> Sub-Group 1 -> Sub-Sub-Group 1 1 7 3 3 Sub-Sub-Group 2 Group 1 -> Sub-Group 1 -> Sub-Sub-Group 2 2 4 2 2 Sub-Group 2 Group 1 -> Sub-Group 2 1 2 null 1 Group 2 Group 2 2 6 null 1 Group 3 Group 3 3
I have created a linked server using my local SQL2005. The linked server can be seen as a linked server, but the database can not been expanded to see the tables, stored procedures, views, and other details regarding the linked server. The only method that I have found that will allow me to see all the details is to use XP's Remote Desktop Connection to access the database. Has anyone else experienced this problem, if so, how did you resolve it?
I extracted data from a flat file using SSIS package and load them into destination table. One column contains no data. Data type of that column is varchar(9). I want to display "NULL" values in that column.
I used LOOK up transformation and used the following query.
SELECT PassThroughRouting = CASE PassThroughRouting WHEN 'NULL' THEN 'NULL' END FROM EPICWareTable
Hi, In my report, I have a table that displays all the data from query. I need to take the value of the 3rd row,2nd column of the table and display in a text box. I tried to do like:
=ReportItems("TextBox2").Value., where TextBox2 is the 3rd row,2nd column of the table. This returns just the first row value of the seleted data. But, I need the 3rd row value.
For some reason whenever I look at the SQL statement of a particular table, the table name displays twice.For example,SELECT * FROM State StateEven when I execute this statement, it still returns the correct results. It does this for all tables in this particular database. I also check another database and thoses display the table names in the SQL statements correctly. Does anyone know why the table name would display twice in a table inside of a particular database?
I am having problems displaying time values in my SSRS report. below is info. Tried expressions still does not work. I want the values to show what in the SQL Server table 00:00:00.82. I tried stored proc still does not work.
SQL Server table time value shown in milliseconds: 00:00:00.82
I have simple pivot table (below screenshot with info redacted) that displays a population number ("N" below), this is the denominator, a cumulative numerator number (below "#") and a simple cumulative percent that just divides the numerator by the denominator. It cumulates from top to bottom. The numerator and percent are cumulative using the below functions. There are two problems with the numerator and percent:
1. When there is not a number for the numerator, there is no value displayed for both the numerator and the percent..There should be a zero displayed for both values. 2. When there has been a prior number for the numerator and percent (for a prior month interval) but there is no number for the numerator in the current month interval, the prior month number and percent are not displayed in the current month interval--see the 3rd yellow line, this should display "3" and "16.7%" from the second yellow line.Here is the formula for the numerator:
=CALCULATE(count(s1Perm1[entity_id]),FILTER(ALL(s1Perm1[ExitMonthCategory]),s1Perm1[ExitMonthCategory] <= MAX(s1Perm1[ExitMonthCategory]))) Here is the formula for the percent: =(CALCULATE(countrows(s1Perm1),FILTER(ALL(s1Perm1[ExitMonthCategory]),s1Perm1[ExitMonthCategory] <= MAX(s1Perm1[ExitMonthCategory]))))/(CALCULATE(COUNTROWS(s1Perm1),ALL(s1Perm1[Exit],s1Perm1[ExitMonthCategory])))
I used to do this with classic asp but I'm not sure how to do it with .net.Basically I would take a table of Categories, Then I would loop through those. Within each loop I would call another stored procedure to get each item in that Category. I'll try to explain, Lets say category 2 has a player Reggie Bush and a player Drew Brees, and category 5 has Michael Vick, but the other categories have no items.Just for an example.. Category Table: ID Category1 Saints2 Falcons3 Bucaneers4 Chargers5 FalconsPlayer Table:ID CategoryID Player News Player Last Updated1 1 Reggie Bush Poetry in motion 9/21/20062 1 Drew Brees What shoulder injury? 9/18/20063 5 Michael Vick Break a leg, seriously. 9/20/2006 Basically I would need to display on a page:SaintsReggie BushPoetry in MotionFalconsMichael VickBreak a leg, seriously.So that the Drew Brees update doesnt display, only the Reggie Bush one, which is the latest.I have my stored procedures put together to do this. I just don't know how to loop through and display it on a page. Right now I have two datareaders in the code behind but ideally something like this, I would think the code would go on the page itself, around the html.
If String AB06 is then I need to get AB05; if it is AB11 I need to get AB10.
My select statement looks like this:
select 'AB'+(cast(substring(period,3,2) as int)-1) from table.
Result is AB6. But I want AB06 (ABzero6)
But when I do this, I'm getting AB6 instead of AB06. Can someone please tell me how to have '0' in front of 6? I guess when I cast it as integer, it is ignoring the leading 0.
I've managed to grouped by Category field nicely and added extra calculated column for handling to total plus as well as Total for each group plus added a new row for TOTAL in the TABLE and returned as follow:
Now I want to put another extra row underneath TOTAL for handling the calculated but the business rule is only for displaying from the first group for instance:
Code Snippet
TOTAL: $3032
Calculated Average per fruits: $1010.67 ($3032 / 3 UNITS).
3 UNITS is coming from Units for Apple and Banana.
I don't know if I can do this cause i did try to use
Code Snippet
=SUM(IIF(Fields!Category.value = "FRUITS", Fields!Units.Value, 0)) But it's successfully compiled but the report result error (#Error) on that field only. Any ideas?
I thought a simple like this can be handled quite easily instead of creating a new report view type in the the same dataset to handle this particular extra line.
I am trying to create a user permission system that is stored in a database. What is the best table structure for accomplishing this? How could I display the permissions in a grid? Currently I have a users table and a permissions table. I created a map between the two. However, I don't see how this allows me to display a grid. All my "columns" for permissions are actually rows from the permissions table. So ideally my grid would look something like this. User | P1 | P2 | P3 |A | T | F | T |B | T | T | T |Thanks for any help. I am relatively new to SQL so please explain gently.
Hi, I am a new VWD user and have been trying to set up a website that allows 1 user to upload images into to SQL Express database and then display them with a variety of other fields. I have searched the forums, several books and many ASP "training" websites to find out how to do this. Every website seems to teach how to display a list of employees or show photo gallery, but none explains how to upload an image, save it in the appropriate field(s) in the database, and then display it when requested in a Datagrid or Details View using VWD and SQL Express 2005 Can any one give me directions to a solution, or send me a simple solution to this? The best example of what I need is is a real estate listing, wherethe property for sale has 8 to 10 descriptive fields and 1 to 3 images that are displayed. Any help would be appreciated. Spacecaetrg.
I have built an ADP for an internal project. The rpoblem I'm having is that one computer is not displaying reports. No matter who the user is it will not show the reports. I thought it might be a software issue/conflict, so I changed out the hardrive and started with a clean OS with only MS Office installed on it. I have also made sure that the users have access rights to SQL along with all sprocs used in the reports. But I'm still having the same problem. There are four other computers in the office that use the application and all work fine. If anyone has any ideas or suggestions I would be glad to hear them.
I basically want to display the single row that has the highest 'jobid' using a SP. I was playing with MAX(jobid) but getting errors about no group by, etc. Where do I begin with this?
SELECT Purchord, JobNo, Descr, customer, jobid FROM Jobs
I am hoping someone can help me on this. I have lost the ability to see tables in one database. I can see views and have full access rights on this database. I was trying to install OLAP Analysis on my PC and suddenly I lost this capability on one of the databases I access. Any thoughts? I have looked at everything I can find trying to fix this. Have re-installed and even cleared my user and re-added. It is something on my PC alone since it also affects anyone who signs on to my box.
I have a list box getting a filtered recordset from a stored procedure using ADO calling in VB6. The recordset returns the two records with correct values. The problem is it is not displaying in the list box. Why? I tried using .additem property but it is not available in Access 2000. Can anyone help me with this?
Function .. Dim rs_get_defect_desc As New ADODB.Recordset, lot_n as integer Set lot_n = 4051
Rs_get_defect_desc.Open "EXEC spGet_desc_defect @lot_n=" & lot_n, CurrentProject.Connection Do While Not rs_get_defect_desc.EOF
My problem arises when I want to display First Name and Last Name for both the POCusername and the AssigneeUserName since FirstName and LastName columns exists once in the Personnel table. How can I display the columns twice. Lets say POCFirstName, POCLastName, AssigneeFirstName, and AssigneeLastName. Or this is something that can't be done.
The query below only display the Assignee info. Of course, I need to something else to display the POC info as well...don't where to go from here...
select tblPersonnel.FirstName, tblPersonnel.LastName, tblAsset.AssigneeUserName, tblAsset.POCUserName from tblVendor, tblAsset, tblPersonnel where and tblPersonnel.UserName = tblAsset.AssigneeUserName and tblAsset.POCUserName in(select tblPersonnel.UserName from tblAsset, tblPersonnel where tblPersonnel.UserName= tblAsset.POCUserName)
Hi do u know what the shortcut or the code command to diplay an SP code in QA. Instead of right clicking the SP in QA and clicking "Script object to New window as Create" is there a command or a shortcut that I can type using keyboard Thank you
I need to add up the number of people who joined this month and compare that number to the number of people who joined last month and display the results in a report:
FirstName..LastName.....StartedDate Randy......Simpson......5/4/2007 10:00:00 PM Steve......Rowe.........5/2/2007 10:00:00 PM Eric.......Dickerson....5/4/2007 10:00:00 PM Gloria.....Sanches......5/1/2007 12:00:29 AM Andres.....Marcelino....5/1/2007 12:06:31 AM katie......ryan.........6/4/2007 12:08:35 AM Denise.....River........6/4/2007 12:27:14 AM Kellog.....Stover.......6/5/2007 12:37:20 AM Glenn......Sanders......6/1/2007 12:42:40 AM
I want to use a hosting service that has ssrs capability. I am using asp to generate a website that's data driven by sql 2005. I want to know if it's possible to display the reports I've created to anyone on the web site with the use of URLs to the report rdl. Can this be done on an asp page or does it have to be an aspx page (.net)? It seems like this would be a very common application of sql and report services. Thank you for any help you can give me.
I've got a report with a table holding a subreport that contains a number of Dundas charts. Each of these charts displays A LOT of data.
Now... after deploying the report, only a few charts at the bottom of the report are displayed -- the rest display the Image-doesn't-exist icon (File image with red X across it). Can anyone tell me what's going on? My best guess is that this is a memory issue on the server side...
I want to return a table that shows each toy and what colors it is available in. Column1 - Toys | Column2 - Comma separated list of colors Ball - Green, Blue Kite - Red Frisbee -
I have absolutely no idea how to do this even after googling all morning. Please help if you can. There must be a way to do this!
I'm having an issue where the Textbox in a RS Report (1 page) is not showing up. I have 4 reports all of which are basically the same except 1 or 2 different wordings however on all of them they are not showing up using http://localhost/reports . If i'm in Visual Studio and click on preview report I see everything just fine. But when I view online (pdf, html, excel) it does not show. The footer however shows up fine on all of them. Does anyone have a fix?
PS: The wierd thing is that on Production they are working but on the Test server they are not and nothing has changed. Both servers are running the same version of SQL 2005. I need to re-deploy the reports coming soon with changes but I am afraid that Production will stop working then.
I've got an xml and an xslt - I want to get that into reporting services. Right now I have a link to the xml file in a 'report', which will open it correctly and format with the xslt. I'd like it to display without going to an external link.
I know how to use an xml datasource, but I need the xslt applied, since it has some nice formatting in it - so i don't think that will work.
I'm trying to report on the results of a scripted ms baseline security analyzer of several servers - the style sheet lets you drill down and has links to the base reports.
I need to show the whole number and remainder each as wole numbers. I have been trying to use modulo on the advice from a friend, but I don't understand this function.
More of an exlpanition: I am working with inventory and shipping quantities. If a pallet consists of 9 cases, and I have an order for 20 cases, I need to display in a report 2 pallets and 2 cases. These numbers can be in the same column or different columns...at this point I just need to be able to display the numbers.
Is there any way to do this? Any help would be appreciated.
-Thanks
P.S.
I posted this in the general forums before I realized I was there...not sure how to move posts, so I double-posted....sorry.