Click here to Skip to main content
       

Database

 
GeneralRe: sql server PinmemberPIEBALDconsult18-Jan-13 14:36 
AnswerRe: sql server PinmemberPIEBALDconsult18-Jan-13 4:04 
GeneralRe: sql server PinmemberShameel22-Jan-13 4:31 
QuestionDo I need a pivot Query? PinmemberGREG_DORIANcod16-Jan-13 10:09 
AnswerRe: Do I need a pivot Query? PinmemberMycroft Holmes16-Jan-13 19:36 
GeneralRe: Do I need a pivot Query? PinmemberGREG_DORIANcod17-Jan-13 1:59 
AnswerRe: Do I need a pivot Query? PinmemberJörgen Andersson21-Jan-13 8:58 
QuestionTotals of each transaction type PinmemberRichard.Berry10015-Jan-13 21:38 
Hi
 
How can I get the total number of two types of transaction between two dates per user
 
Example data:
 
User TransactionType MovementDate
Avril RECP 2012/01/04
Pat RECP 2012/01/09
Pat SRET 2012/01/09
 
What I would like is the following:
 
User Recipts Returns
Avril 1 0
Pat 1 1
 

This is where I was heading, but as soon as I put in a where clause to limit the date range I get an Error " Incorrect column expression: 'SUM(CASE WHEN stkhistm.transaction_type = 'RECP Then 1 else 0 end)'
SELECT 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
WHERE stkhstm.movement_date>=[?] 
 

 

AnswerRe: Totals of each transaction type PinmemberMycroft Holmes15-Jan-13 22:57 
GeneralRe: Totals of each transaction type PinmemberRichard.Berry10016-Jan-13 0:36 
GeneralRe: Totals of each transaction type PinmemberPIEBALDconsult16-Jan-13 3:42 
GeneralRe: Totals of each transaction type PinmemberRichard.Berry10016-Jan-13 5:36 
QuestionCustomize color coding in SQL editor window [modified] Pinmemberbiop.codeproject15-Jan-13 20:04 
AnswerRe: Customize color coding in SQL editor window PinmemberMycroft Holmes15-Jan-13 22:51 
GeneralMessage Removed Pinmemberbiop.codeproject16-Jan-13 19:26 
GeneralRe: Customize color coding in SQL editor window PinmemberMycroft Holmes16-Jan-13 19:34 
GeneralRe: Customize color coding in SQL editor window PinmemberShameel22-Jan-13 4:41 
Questionquery.. Pinmembervishal.v.patil14-Jan-13 17:49 
AnswerRe: query.. PinmemberMycroft Holmes14-Jan-13 17:54 
GeneralRe: query.. Pinmembervishal.v.patil14-Jan-13 18:21 
GeneralRe: query.. PinmemberBlue_Boy15-Jan-13 3:11 
QuestionBuilding dictionary translation PinmemberY@ssco14-Jan-13 16:19 
AnswerRe: Building dictionary translation PinmemberMycroft Holmes14-Jan-13 17:52 
GeneralRe: Building dictionary translation PinmemberY@ssco14-Jan-13 18:41 
GeneralRe: Building dictionary translation PinmemberMycroft Holmes14-Jan-13 18:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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
Web01 | 2.8.140709.1 | Last Updated 11 Jul 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid