Link to home
Start Free TrialLog in
Avatar of jasimon9
jasimon9Flag for United States of America

asked on

Compute clause displays nothing in Enterprise Manager

I have a simple query with totals. Here is the query:

SELECT     D.ManufacturerId, M.CompanyName, D.DatePaid, D.Amount
FROM         PaidMfgDtl D INNER JOIN
                      dbo.Manufacturers M ON D.ManufacturerId = M.ManufacturerId INNER JOIN
                      dbo.Users U ON M.UserId = U.UserId
WHERE     (D.DatePaid > GETDATE() - 1) AND (D.DatePaid < GETDATE() + 3)
ORDER BY D.DatePaid, D.ManufacturerId
COMPUTE SUM(d .amount)

The query executes normally in Query Analyzer and displays the totals as separate query results. However, in Enterprise Manager, only the main query is displayed. How do I get the COMPUTE clause queries to display in Enterprise Manager?
ASKER CERTIFIED SOLUTION
Avatar of rafrancisco
rafrancisco

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jasimon9

ASKER

One reason I like Enterprise Manager is that it allows easy pasting into Excel for Q & D reporiting. When you cut from Query analyzer, there are no column headings.
Avatar of rafrancisco
rafrancisco

If you want to copy and paste to Excel to include the column headings, this can also be done in Query Analyzer.

Before running your statement, go to Tools --> Options.  Then go to Results.  In the Defaul results target, select Results to Text.  In the Results output format, select Tab Delimited.  Then click Apply.  Make sure the Print column headers is checked as well.  Then run your query.  You can then copy and paste the result to Excel.
Thanks for the tip. At this point, it appears that you have answered my original question so I am awarding points.