Hey that's what exactly i was looking for.
Thanks a lot ..........
User Profile
Collapse
-
Delerna,
You suggested a good option, but companies are not going to be 3 only.
Think about the case when someone add a new company 'Company4' and 'Company5' in "Company' table.
I think then your querry will show result only for company 1,2 and 3 but not 4 and 5.
I am looking for something else here....Leave a comment:
-
Also i would ike to add that
with following querry,
[code=sql]
SELECT DATENAME(MONTH, sales.SalesDate ) AS [Month], YEAR(sales.Sale sDate) AS [Year],
SUM(ISNULL(sale s.Units,0)) AS Units
FROM Sales
WHERE Sales.CompanyID = '1'
AND HORevenueTransc ation.EntryDate BETWEEN '01/01/2008' AND '12/31/2008'
GROUP BY YEAR(sales.Sale sDate), DATENAME(MONTH, sales.SalesDate )
ORDER BY YEAR(sales.Sale sDate),...Leave a comment:
-
Converting rows in column header
Hello,
I have two tables.
Table 1 name is Company
Table 2 is Sales
Data in 'Company' table is,
CompanyID CompanyName
--------------------------------------------
1 Company1
2 Company2
3 Company3
Data in 'Sales' table is
ID CompanyID SalesDate Units
---------------------------------------------------------------...
No activity results to display
Show More
Leave a comment: