How to insert a total column in a crosstab report in VS 2008 - designer

How to insert a total column in a crosstab (matrix) report in Report Designer in VS 2008?
It seems that i can only insert a subcolumn in a crosstab report.

Ok I got it now. I just right-clicked the column header and selected Subtotal.

Related

Convert SQL Script to Tableau Calculated Table

I'm new to Tableau and was wondering how I could create a calculated field that would be equivalent to this SQL statement:
Select studentid, min(semester)
I'm trying to get the very first recorded semester for each student.
Thanks
{fixed [StudentID]:min([Semester])}
Try using this in a calculated field.

How to Generate SubReport in crystal report with SQL Query?

I am Having a Report Which has to generate from Two different where Clauses.
**Condidtion 1**
Select * from Table1 where Name="ABC"
**Condition2**
Select * from Table1 where city="LA"
In above mentioned case, the condition two should appear in sub report part
Please remember the Data is populatinf from same table and in same crystal report
Condition 2 Will be in subreport
Create a Datasoruce and name the subreport as sub1 or anything paste the following code
rptdoc.Subreports("sub1").SetDataSource(dv1)

How to show a dataset field in a single textbox ssrs

I have created a dataset in SSRS which is hooked to a Stored procedure. The stored procedure resultset includes the following columns
OutputID, Timestamp, ProductName, Price, ProductNumber.
I show the above in a tablix in my report which works perfectly fine. I have about 10 rows.
The question I have is
I want a textbox on my report which will show productNumber as follows
1,2,3,4,5,6,7,8,9,10
I am fairly new to SSRS so forgive my ignorance.
The backend is SQL Server 2008 R2.
Try this in the textbox expression
=Join(LookupSet(1, 1, "FIELD NAME,"DATASETNAME"),",")
this will concatenate the result with comma

Create an insert script from select results

Using SQL Server Management Studio is there a way I can select one or more rows in the grid of select results and have SQL Server Mangement Studio generate one or more insert statements (one for each row selected) which would insert that data into a table with the same schema?
Edit: I know how to create one manually, but I was hoping there would be something that would create it automatically for me. If you are familiar with Toad there is a way to have Toad generate inserts based on data in the results pane and I was hoping SSMS had an equivalant function.
Try to save the query result into a disposable table.
For example:
SELECT * INTO disposable_customer_table FROM customer_table WHERE id IN (in range of something)
Then do a db -> Tasks -> Generate Scripts.
Select specific database objects.
Choose disposable_customer_table from the list of table names.
Choose Save to file.
Make sure to do an Advance setup and select "Data only" from the 'Types of data to script'.
Tweak the result file and rename the disposable_customer_table back to the original table name.
Clean it up and drop the disposable_customer_table.
select 'insert into tableB values (', tableA.x ,',',tableA.y,',',tableA.z,')' from tableA
I think you have two options here:
Create your inserts manually. For instance:
select Name, Surname,
'insert into Person (Name,surname) values ('''+Name+''','''+Surname+')'
from Person
This gets you the results and, in the last column, the insert script for the row. You can then select and paste it in an Editor window.
Right click on the db -> Tasks -> Generate Scripts. Press then Advance and select "Data Only" (Default is Schema Only).
Perform your query and right click on the blank area where the column headers meet the row number in the Results view.
You can then select Script Grid Results:

Pivot sql query

I've SQL Server 2005 table
COMPETITOR (Id, Title, cDate, Price)
I want to format the query so that its view in Gridview will be like this:
Please help me writing the sql query.
SQL 2005 supports PIVOT - the Books Online doc is http://msdn.microsoft.com/en-us/library/ms177410(SQL.90).aspx
The main shortcoming I've found with the PIVOT stuff is that you must specify the column names, although you can use a query beforehand and inject the values into a varchar variable and then execute that.