Click here to Skip to main content
15,919,178 members
Home / Discussions / Database
   

Database

 
QuestionFunction to create Enterprise Library Database object from Connection String Pin
nwaheed29-Sep-08 19:57
nwaheed29-Sep-08 19:57 
Questionhoe to return more than parameter Pin
prasadbuddhika29-Sep-08 19:39
prasadbuddhika29-Sep-08 19:39 
AnswerRe: hoe to return more than parameter Pin
HemJoshi29-Sep-08 20:18
HemJoshi29-Sep-08 20:18 
Questionconvert font Pin
tungcan5diop29-Sep-08 18:16
tungcan5diop29-Sep-08 18:16 
AnswerRe: convert font Pin
HemJoshi29-Sep-08 19:10
HemJoshi29-Sep-08 19:10 
Questionxds Pin
postonoh29-Sep-08 11:34
postonoh29-Sep-08 11:34 
AnswerDuplicate post Pin
Mycroft Holmes29-Sep-08 14:54
professionalMycroft Holmes29-Sep-08 14:54 
QuestionNumber of opened accounts per month Pin
matt23lucier29-Sep-08 9:40
matt23lucier29-Sep-08 9:40 
I am trying to get the number of opened accounts per month in. For the most part I can get this information but if there was no account opening for March then March does not show up in the list. Here is what I have.

select Months, count(*) as 'Account Openings' from
(
SELECT
CASE
WHEN opened >= '2007-01-01' and opened <= '2007-02-01' THEN 'January'
WHEN opened >='2007-02-01' and opened <= '2007-03-01' THEN 'February'
WHEN opened >= '2007-03-01' and opened <= '2007-04-01' THEN 'March'
WHEN opened >= '2007-04-01' and opened <= '2007-05-01' THEN 'April'
WHEN opened >= '2007-05-01' and opened <= '2007-06-01' THEN 'May'
WHEN opened >= '2007-06-01' and opened <= '2007-07-01' THEN 'June'
WHEN opened >= '2007-02-01' and opened <= '2007-08-01' THEN 'July'
WHEN opened >= '2007-08-01' and opened <= '2007-09-01' THEN 'August'
WHEN opened >= '2007-09-01' and opened <= '2007-10-01' THEN 'September'
WHEN opened >= '2007-10-01' and opened <= '2007-11-01' THEN 'October'
WHEN opened >= '2007-11-01' and opened <= '2007-12-01' THEN 'November'
ELSE 'December'
END AS Months
FROM account
WHERE opened >= '2007-01-01' AND opened <= '2007-12-31'
) as OpenedPerMonth
group by Months
order by Months

I would get something like this as output
April 12
August 44
February 55
January 19
July 12
June 11
March 42
May 11
September 6

Thanks
Matt
AnswerRe: Number of opened accounts per month Pin
leckey29-Sep-08 10:53
leckey29-Sep-08 10:53 
AnswerRe: Number of opened accounts per month Pin
Blue_Boy29-Sep-08 11:21
Blue_Boy29-Sep-08 11:21 
QuestionRe: Number of opened accounts per month Pin
nelsonpaixao29-Sep-08 12:26
nelsonpaixao29-Sep-08 12:26 
QuestionSQL Help Required Pin
munklefish29-Sep-08 5:07
munklefish29-Sep-08 5:07 
AnswerRe: SQL Help Required Pin
Kschuler29-Sep-08 6:15
Kschuler29-Sep-08 6:15 
Question# of records between 2 times Pin
wienfall200329-Sep-08 5:06
wienfall200329-Sep-08 5:06 
AnswerRe: # of records between 2 times Pin
Wendelius29-Sep-08 5:11
mentorWendelius29-Sep-08 5:11 
GeneralRe: # of records between 2 times Pin
wienfall200329-Sep-08 5:23
wienfall200329-Sep-08 5:23 
GeneralRe: # of records between 2 times Pin
Wendelius29-Sep-08 5:42
mentorWendelius29-Sep-08 5:42 
GeneralRe: # of records between 2 times Pin
wienfall200329-Sep-08 7:25
wienfall200329-Sep-08 7:25 
GeneralRe: # of records between 2 times Pin
Wendelius29-Sep-08 7:35
mentorWendelius29-Sep-08 7:35 
GeneralRe: # of records between 2 times Pin
SomeGuyThatIsMe29-Sep-08 8:36
SomeGuyThatIsMe29-Sep-08 8:36 
GeneralRe: # of records between 2 times Pin
wienfall200329-Sep-08 9:10
wienfall200329-Sep-08 9:10 
AnswerRe: # of records between 2 times Pin
nelsonpaixao29-Sep-08 12:40
nelsonpaixao29-Sep-08 12:40 
Questionconnection string Pin
sachees12329-Sep-08 4:44
sachees12329-Sep-08 4:44 
AnswerRe: connection string Pin
Wendelius29-Sep-08 4:57
mentorWendelius29-Sep-08 4:57 
GeneralRe: connection string Pin
sachees12329-Sep-08 18:34
sachees12329-Sep-08 18:34 

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.