Click here to Skip to main content
   

Database

 
GeneralRe: sql server PinmemberRichard Deeming18-Jan-13 3:18 
GeneralRe: sql server PinmvpEddy Vluggen18-Jan-13 3:22 
GeneralRe: sql server PinmemberPIEBALDconsult18-Jan-13 15:36 
AnswerRe: sql server PinmemberPIEBALDconsult18-Jan-13 5:04 
GeneralRe: sql server PinmemberShameel22-Jan-13 5:31 
QuestionDo I need a pivot Query? PinmemberGREG_DORIANcod16-Jan-13 11:09 
AnswerRe: Do I need a pivot Query? PinmemberMycroft Holmes16-Jan-13 20:36 
GeneralRe: Do I need a pivot Query? PinmemberGREG_DORIANcod17-Jan-13 2:59 
AnswerRe: Do I need a pivot Query? PinmemberJörgen Andersson21-Jan-13 9:58 
QuestionTotals of each transaction type PinmemberRichard.Berry10015-Jan-13 22:38 
AnswerRe: Totals of each transaction type PinmemberMycroft Holmes15-Jan-13 23:57 
GeneralRe: Totals of each transaction type PinmemberRichard.Berry10016-Jan-13 1:36 
GeneralRe: Totals of each transaction type PinmemberPIEBALDconsult16-Jan-13 4:42 
GeneralRe: Totals of each transaction type PinmemberRichard.Berry10016-Jan-13 6:36 
Thanks PIEBALDconsult
 
The problem was amongst other things the dates !!
 
This works now:
SELECT user_id, 
SUM(CASE WHEN (stkhstm.transaction_type = 'RECP' AND stkhstm.movement_date >= {ts '2012-01-01 00:00:00'} AND stkhstm.movement_date < {ts '2013-01-01 00:00:00'})  then 1 else 0 end)  , 
SUM(CASE WHEN (stkhstm.transaction_type = 'SRET' AND stkhstm.movement_date >= {ts '2012-01-01 00:00:00'} AND stkhstm.movement_date < {ts '2013-01-01 00:00:00'}) then 1 else 0 end)  
FROM vektron.scheme.stkhstm stkhstm
GROUP BY user_id
 
'BETWEEN' would be a bit more elegant I guess Smile | :)
QuestionCustomize color coding in SQL editor window [modified] Pinmemberbiop.codeproject15-Jan-13 21:04 
AnswerRe: Customize color coding in SQL editor window PinmemberMycroft Holmes15-Jan-13 23:51 
GeneralMessage Removed Pinmemberbiop.codeproject16-Jan-13 20:26 
GeneralRe: Customize color coding in SQL editor window PinmemberMycroft Holmes16-Jan-13 20:34 
GeneralRe: Customize color coding in SQL editor window PinmemberShameel22-Jan-13 5:41 
Questionquery.. Pinmembervishal.v.patil14-Jan-13 18:49 
AnswerRe: query.. PinmemberMycroft Holmes14-Jan-13 18:54 
GeneralRe: query.. Pinmembervishal.v.patil14-Jan-13 19:21 
GeneralRe: query.. PinmemberBlue_Boy15-Jan-13 4:11 
QuestionBuilding dictionary translation PinmemberY@ssco14-Jan-13 17:19 
AnswerRe: Building dictionary translation PinmemberMycroft Holmes14-Jan-13 18:52 
GeneralRe: Building dictionary translation PinmemberY@ssco14-Jan-13 19:41 
GeneralRe: Building dictionary translation PinmemberMycroft Holmes14-Jan-13 19:52 
GeneralRe: Building dictionary translation Pinmemberdjj5515-Jan-13 2:51 
GeneralRe: Building dictionary translation PinmemberY@ssco15-Jan-13 19:23 
AnswerRe: Building dictionary translation PinmvpEddy Vluggen16-Jan-13 3:41 
Questionembedding sql server express in application PinmemberDanzy8313-Jan-13 17:48 
AnswerRe: embedding sql server express in application PinmemberPIEBALDconsult13-Jan-13 18:02 
AnswerRe: embedding sql server express in application PinmvpEddy Vluggen14-Jan-13 3:07 
QuestionSQL Query For String Searching Pinmemberlhsunshine10-Jan-13 4:35 
AnswerRe: SQL Query For String Searching Pinmemberdjj5510-Jan-13 5:40 
GeneralRe: SQL Query For String Searching Pinmemberlhsunshine10-Jan-13 18:51 
AnswerRe: SQL Query For String Searching PinmvpRichard MacCutchan10-Jan-13 5:58 
AnswerRe: SQL Query For String Searching PinmemberPIEBALDconsult10-Jan-13 8:37 
GeneralRe: SQL Query For String Searching Pinmemberlhsunshine10-Jan-13 12:55 
GeneralRe: SQL Query For String Searching PinmemberPIEBALDconsult10-Jan-13 13:43 
GeneralRe: SQL Query For String Searching Pinmemberlhsunshine10-Jan-13 18:01 
GeneralRe: SQL Query For String Searching PinmemberPIEBALDconsult10-Jan-13 18:44 
AnswerRe: SQL Query For String Searching Pinmemberjschell10-Jan-13 15:10 
GeneralRe: SQL Query For String Searching PinmemberPIEBALDconsult11-Jan-13 17:55 
JokeRe: SQL Query For String Searching PinmvpEddy Vluggen11-Jan-13 18:18 
QuestionMaximum number of concurrent connections to SQL Server 2008 PinmemberDanzy8310-Jan-13 2:21 
AnswerRe: Maximum number of concurrent connections to SQL Server 2008 PinmemberDavid Mujica10-Jan-13 3:56 
AnswerRe: Maximum number of concurrent connections to SQL Server 2008 PinmemberPIEBALDconsult10-Jan-13 4:03 
GeneralRe: Maximum number of concurrent connections to SQL Server 2008 PinmemberMycroft Holmes10-Jan-13 12:47 
GeneralRe: Maximum number of concurrent connections to SQL Server 2008 PinmemberPIEBALDconsult10-Jan-13 14: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
Web03 | 2.8.150129.1 | Last Updated 31 Jan 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid