Click here to Skip to main content
12,623,744 members (32,027 online)
   

Database

 
GeneralRe: sql server Pin
Shameel22-Jan-13 5:31
memberShameel22-Jan-13 5:31 
QuestionDo I need a pivot Query? Pin
GREG_DORIANcod16-Jan-13 11:09
memberGREG_DORIANcod16-Jan-13 11:09 
AnswerRe: Do I need a pivot Query? Pin
Mycroft Holmes16-Jan-13 20:36
memberMycroft Holmes16-Jan-13 20:36 
GeneralRe: Do I need a pivot Query? Pin
GREG_DORIANcod17-Jan-13 2:59
memberGREG_DORIANcod17-Jan-13 2:59 
AnswerRe: Do I need a pivot Query? Pin
Jörgen Andersson21-Jan-13 9:58
memberJörgen Andersson21-Jan-13 9:58 
QuestionTotals of each transaction type Pin
Richard.Berry10015-Jan-13 22:38
memberRichard.Berry10015-Jan-13 22:38 
AnswerRe: Totals of each transaction type Pin
Mycroft Holmes15-Jan-13 23:57
memberMycroft Holmes15-Jan-13 23:57 
GeneralRe: Totals of each transaction type Pin
Richard.Berry10016-Jan-13 1:36
memberRichard.Berry10016-Jan-13 1:36 
Oops sorry - SQL Server 2008 R2 - MS Query - Excel

Seem to have got a liitle further:

This works:

SELECT user_id, SUM(CASE WHEN stkhstm.transaction_type = 'RECP' then 1 else 0 end) , 
SUM(CASE WHEN stkhstm.transaction_type = 'SRET' then 1 else 0 end)  
FROM vektron.scheme.stkhstm stkhstm
GROUP BY user_id

Then I tried to add a restriction on the dates:

SELECT user_id, SUM(CASE WHEN stkhstm.transaction_type = 'RECP' then 1 else 0 end) * 
SUM(CASE WHEN stkhstm.movement_date > #01/01/2012# then 1 else 0 end) * sum(CASE WHEN stkhstm.movement_date < #01/01/2013# then 1 else 0 end), 
SUM(CASE WHEN stkhstm.transaction_type = 'SRET' then 1 else 0 end)  
FROM vektron.scheme.stkhstm stkhstm
GROUP BY user_id

But get the same error as before
GeneralRe: Totals of each transaction type Pin
PIEBALDconsult16-Jan-13 4:42
memberPIEBALDconsult16-Jan-13 4:42 
GeneralRe: Totals of each transaction type Pin
Richard.Berry10016-Jan-13 6:36
memberRichard.Berry10016-Jan-13 6:36 
QuestionCustomize color coding in SQL editor window Pin
biop.codeproject15-Jan-13 21:04
memberbiop.codeproject15-Jan-13 21:04 
AnswerRe: Customize color coding in SQL editor window Pin
Mycroft Holmes15-Jan-13 23:51
memberMycroft Holmes15-Jan-13 23:51 
GeneralMessage Removed Pin
biop.codeproject16-Jan-13 20:26
memberbiop.codeproject16-Jan-13 20:26 
GeneralRe: Customize color coding in SQL editor window Pin
Mycroft Holmes16-Jan-13 20:34
memberMycroft Holmes16-Jan-13 20:34 
GeneralRe: Customize color coding in SQL editor window Pin
Shameel22-Jan-13 5:41
memberShameel22-Jan-13 5:41 
Questionquery.. Pin
vishal.v.patil14-Jan-13 18:49
membervishal.v.patil14-Jan-13 18:49 
AnswerRe: query.. Pin
Mycroft Holmes14-Jan-13 18:54
memberMycroft Holmes14-Jan-13 18:54 
GeneralRe: query.. Pin
vishal.v.patil14-Jan-13 19:21
membervishal.v.patil14-Jan-13 19:21 
GeneralRe: query.. Pin
Blue_Boy15-Jan-13 4:11
memberBlue_Boy15-Jan-13 4:11 
QuestionBuilding dictionary translation Pin
Y@ssco14-Jan-13 17:19
memberY@ssco14-Jan-13 17:19 
AnswerRe: Building dictionary translation Pin
Mycroft Holmes14-Jan-13 18:52
memberMycroft Holmes14-Jan-13 18:52 
GeneralRe: Building dictionary translation Pin
Y@ssco14-Jan-13 19:41
memberY@ssco14-Jan-13 19:41 
GeneralRe: Building dictionary translation Pin
Mycroft Holmes14-Jan-13 19:52
memberMycroft Holmes14-Jan-13 19:52 
GeneralRe: Building dictionary translation Pin
djj5515-Jan-13 2:51
memberdjj5515-Jan-13 2:51 
GeneralRe: Building dictionary translation Pin
Y@ssco15-Jan-13 19:23
memberY@ssco15-Jan-13 19:23 

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.


Advertise | Privacy | Mobile
Web02 | 2.8.161128.1 | Last Updated 2 Dec 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid