User Profile

Collapse

Profile Sidebar

Collapse
Kerre
Kerre
Last Activity: Feb 22 '08, 08:52 AM
Joined: Jan 28 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Kerre
    replied to Converting rows in column header
    Hey that's what exactly i was looking for.
    Thanks a lot ..........
    See more | Go to post

    Leave a comment:


  • Kerre
    replied to Converting rows in column header
    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....
    See more | Go to post

    Leave a comment:


  • Kerre
    replied to Converting rows in column header
    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),...
    See more | Go to post
    Last edited by debasisdas; Jan 28 '08, 11:57 AM. Reason: added code tags

    Leave a comment:


  • Kerre
    started a topic Converting rows in column header

    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
    ---------------------------------------------------------------...
    See more | Go to post
No activity results to display
Show More
Working...