Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Before creating a tabular report user must first create data sources, datasets and report parameters (optional) as described in DataSources and Queries.
Below, we use the AdventureWorks sample database that ships with SQL Server Reporting Services 2005.
SQL
SELECT C.FirstName+' '+C.LastName 'Employee',
DATEPART(Month,SOH.OrderDate) 'OrderMonthNum',
PS.Name 'SubCat',
Sum(SOD.LineTotal) 'Sales',
SOH.SalesOrderNumber,
P.Name 'Product',
Sum(SOD.OrderQty) 'OrderQty',
SOD.UnitPrice,
PC.Name 'ProdCat'
FROM AdventureWorks.Person.Contact C,
AdventureWorks.HumanResources.Employee E,
AdventureWorks.Production.Product P,
AdventureWorks.Production.ProductCategory PC,
AdventureWorks.Production.ProductSubcategory PS,
AdventureWorks.Sales.SalesOrderDetail SOD,
AdventureWorks.Sales.SalesOrderHeader SOH,
AdventureWorks.Sales.SalesPerson SP
WHERE SOH.SalesOrderID = SOD.SalesOrderID
AND SOH.SalesPersonID = SP.SalesPersonID
AND SP.SalesPersonID = E.EmployeeID
AND E.ContactID = C.ContactID
AND SOD.ProductID = P.ProductID
AND P.ProductSubcategoryID = PS.ProductSubcategoryID
AND PS.ProductCategoryID = PC.ProductCategoryID
AND ((DATEPART(Year,SOH.OrderDate)=?)
AND (DATEPART(Month,SOH.OrderDate)=?) AND (SOH.SalesPersonID=?))
GROUP BY C.FirstName+' '+C.LastName, DATEPART(Month,SOH.OrderDate),
PS.Name,
SOH.SalesOrderNumber,
P.Name,
SOD.UnitPrice,
PC.Name
SQL
SELECT E.EmployeeID, C.FirstName + N' ' + C.LastName AS Employee
FROM HumanResources.Employee E INNER JOIN Sales.SalesPerson SP
ON E.EmployeeID = SP.SalesPersonID INNER JOIN Person.Contact C
ON E.ContactID = C.ContactID ORDER BY C.LastName, C.FirstName




Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.