Re: Help with missing data in query



On Thu, 16 Aug 2007 19:38:04 -0700, SLIMSHIM wrote:

THanx for the help
I did go to that site But I couldn't figure out how to upload anything.

Hi slimshim,

You don't need to upload anything. The site describes the information
you need to supply to give people the best chance to help you. You just
read that site, assemble the information, then post that information in
your next question.

after i tried your suggested changed this is what my result looks like
Jan 0 0 0
Total 12 0 12
Feb 0 0 0
Mar 0 0 0
Apr 0 0 0
May 0 0 0
Jun 0 0 0
Jul 12 0 12
Aug 0 0 0
Sep 0 0 0
Oct 0 0 0
Nov 0 0 0
Dec 0 0 0

I'm surpried - for a quick test on some scratch data, I got the total as
the very first line.

Try changing the ORDER BY clause to read either

GROUP BY m.MonthName WITH ROLLUP
ORDER BY GROUPING(m.MonthName), MIN(m.MonthId)

or

GROUP BY m.MonthID WITH ROLLUP
ORDER BY GROUPING(m.MonthID), m.MonthID

depending on which version of the query you are now using.

I was wondering if I could use COMPUTE intead of coalese to get the total
heading to the bottom ?

COMPUTE is a deprecated feature and will be removed in a future version
of SQL Server. Don't use it for new work, and replace it if you have it
in existing code.

--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
.



Relevant Pages

  • Re: Help with missing data in query
    ... I did go to that site But I couldn't figure out how to upload anything. ... GROUP BY m.MonthName WITH ROLLUP ... Hugo Kornelis, SQL Server MVP ...
    (microsoft.public.sqlserver.mseq)
  • Re: Uploading documents fail - SharePoint Services/Remote SQL 2k Server
    ... Mike Walsh, Helsinki, Finland ... was unable to upload files larger than 5Mb, ... solve it by allocating more memory for SQL server. ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: Mange Large file in the database
    ... With a big amount of data that is uploaded to SQL server from the Web you ... MS SQL can handle huge amount of data. ... model for your database. ... project is to upload data from clinte machine and save these data to SQL ...
    (microsoft.public.dotnet.framework.aspnet)
  • ASP.NET Configuration tool missing from menu
    ... I've uploaded my club site files, ... my DB is in SQL Server on the web host... ... table is empty so I have no one to login to the website with. ... I have done the DB merge and website upload from a different computer ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Upload image into SQL Server database
    ... How do I build the form so that includes both an insert into an SQL Server ... "Kevin Spencer" wrote in message ... > path to the image in the database. ... >> I need them to be able to upload an image as well and to have it saved ...
    (microsoft.public.frontpage.programming)