Click here to Skip to main content
15,897,891 members
Home / Discussions / Database
   

Database

 
AnswerRe: select statement to display name 1000 times Pin
Ashfield1-Dec-09 0:09
Ashfield1-Dec-09 0:09 
GeneralRe: select statement to display name 1000 times Pin
arun_pk1-Dec-09 0:22
arun_pk1-Dec-09 0:22 
GeneralRe: select statement to display name 1000 times Pin
Ashfield1-Dec-09 0:25
Ashfield1-Dec-09 0:25 
GeneralRe: select statement to display name 1000 times Pin
Shameel1-Dec-09 7:05
professionalShameel1-Dec-09 7:05 
GeneralRe: select statement to display name 1000 times Pin
Mycroft Holmes1-Dec-09 17:04
professionalMycroft Holmes1-Dec-09 17:04 
GeneralRe: select statement to display name 1000 times Pin
Ashfield1-Dec-09 21:37
Ashfield1-Dec-09 21:37 
GeneralRe: select statement to display name 1000 times Pin
Mycroft Holmes1-Dec-09 21:55
professionalMycroft Holmes1-Dec-09 21:55 
QuestionHow to Group By all columns but have Rollup only on few columns Pin
guydebell30-Nov-09 23:10
guydebell30-Nov-09 23:10 
I am new to SQL coding and having trouble grouping and generating sub totals and Grand Totals for a report generated by this query:

SELECT ISNULL(CAST(dteAccountingDate AS varchar (20)),'') AS MonthEnd,Payee, ClientName,
ISNULL (CAST (Accrual as varchar (20)),'') AS Accrual,
ISNULL (CAST (Payment as varchar (20)),'') AS Payment,
ISNULL (CAST (OverUnder as varchar (20)),'') AS OverUnder,
ISNULL (CAST (Salaries as varchar (20)),'') AS AnnualisedSalaries,
ISNULL (CAST (PercentVal as varchar (20)),'') AS Percentage,
ISNULL (CAST (CountMem as varchar (20)),'') AS NoMember,
ISNULL (CAST (CostPerMem as varchar (20)),'') AS CostPerMember

FROM #tmp INNER JOIN tblClientParents
ON #tmp.fkiClientParentID = tblClientParents.pkiClientParentID
AND Payee NOT IN ('Opening Value','Current Year','Sub Totals','Totals', '','______________','Prior Year Payment')


My primary objective is to have results grouped and summaries generated by Payee and ClientName.
I tried group by and order by but they don't give me the required results; even tried Compute By. I want to use Group by With Rollup but the problem is i only want to generate summaries of three columns Accrual, Payment and CountMem.

Is there a way to Group by all the columns in the select query but have Rollup only on the three columns? Or any other ways to generate summaries on the three columns only?

I also tried Group By Rollup, it doesn't work with SQL Server 2008 that i am using.


Need some help here please!



Thanks in advance
AnswerRe: How to Group By all columns but have Rollup only on few columns [modified] Pin
Niladri_Biswas30-Nov-09 23:33
Niladri_Biswas30-Nov-09 23:33 
GeneralRe: How to Group By all columns but have Rollup only on few columns Pin
guydebell1-Dec-09 1:05
guydebell1-Dec-09 1:05 
QuestionHow to connect/disconnect users in sql server. Pin
Ashish Kumar Vyas30-Nov-09 20:13
Ashish Kumar Vyas30-Nov-09 20:13 
AnswerRe: How to connect/disconnect users in sql server. Pin
Ashfield30-Nov-09 20:57
Ashfield30-Nov-09 20:57 
Questioninserting multiple rows Pin
arun_pk30-Nov-09 18:07
arun_pk30-Nov-09 18:07 
AnswerRe: inserting multiple rows Pin
_Damian S_30-Nov-09 18:18
professional_Damian S_30-Nov-09 18:18 
GeneralRe: inserting multiple rows Pin
arun_pk30-Nov-09 18:21
arun_pk30-Nov-09 18:21 
GeneralRe: inserting multiple rows Pin
dan!sh 30-Nov-09 18:32
professional dan!sh 30-Nov-09 18:32 
GeneralRe: inserting multiple rows Pin
arun_pk30-Nov-09 18:36
arun_pk30-Nov-09 18:36 
GeneralRe: inserting multiple rows Pin
_Damian S_30-Nov-09 18:37
professional_Damian S_30-Nov-09 18:37 
GeneralRe: inserting multiple rows Pin
_Damian S_30-Nov-09 18:37
professional_Damian S_30-Nov-09 18:37 
GeneralRe: inserting multiple rows Pin
dan!sh 30-Nov-09 18:57
professional dan!sh 30-Nov-09 18:57 
GeneralRe: inserting multiple rows Pin
_Damian S_30-Nov-09 18:36
professional_Damian S_30-Nov-09 18:36 
GeneralRe: inserting multiple rows Pin
arun_pk30-Nov-09 18:52
arun_pk30-Nov-09 18:52 
GeneralRe: inserting multiple rows Pin
_Damian S_30-Nov-09 18:54
professional_Damian S_30-Nov-09 18:54 
GeneralRe: inserting multiple rows Pin
dan!sh 30-Nov-09 19:02
professional dan!sh 30-Nov-09 19:02 
AnswerRe: inserting multiple rows Pin
Niladri_Biswas30-Nov-09 20:06
Niladri_Biswas30-Nov-09 20:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.