Click here to Skip to main content
15,886,137 members
Home / Discussions / Database
   

Database

 
JokeRe: how to create a local search engine? Pin
PIEBALDconsult4-Oct-07 9:46
mvePIEBALDconsult4-Oct-07 9:46 
GeneralRe: how to create a local search engine? Pin
LyndonJohn5-Oct-07 7:24
LyndonJohn5-Oct-07 7:24 
QuestionMS Access 2003 and Triggers Pin
Ryno Burger4-Oct-07 7:17
Ryno Burger4-Oct-07 7:17 
Questionproblem with date calculation Pin
ahmed_fci20064-Oct-07 1:39
ahmed_fci20064-Oct-07 1:39 
AnswerRe: problem with date calculation Pin
pmarfleet4-Oct-07 4:16
pmarfleet4-Oct-07 4:16 
AnswerRe: problem with date calculation Pin
Blue_Boy4-Oct-07 4:22
Blue_Boy4-Oct-07 4:22 
Questiongroup by problem(plz help me) Pin
Arihant rathi4-Oct-07 1:31
Arihant rathi4-Oct-07 1:31 
AnswerRe: group by problem(plz help me) Pin
andyharman4-Oct-07 1:40
professionalandyharman4-Oct-07 1:40 
Hi Ajay

Try something like:
select month(Post_Date) as Post_Month,
    year(Post_Date) as Post_Year,
    sum(case when Status = 'Active' then 1 else 0 end) as Active,
    sum(case when Status = 'Inactive' then 1 else 0 end) as Billed
from tbl_Post_Job
where Company_Id_Fk = 60
group by year(Post_Date), month(Post_Date)
order by year(Post_Date), month(Post_Date)
The case expressions allow you to count the number of rows that match their criteria.

Regards
Andy

If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message".

GeneralRe: group by problem(plz help me) Pin
Arihant rathi4-Oct-07 3:13
Arihant rathi4-Oct-07 3:13 
Questioninserting values with a nested join query Pin
anuradha.rrao4-Oct-07 1:18
anuradha.rrao4-Oct-07 1:18 
AnswerRe: inserting values with a nested join query Pin
Paddy Boyd4-Oct-07 1:34
Paddy Boyd4-Oct-07 1:34 
QuestionQuery required Pin
veereshIndia3-Oct-07 23:06
veereshIndia3-Oct-07 23:06 
AnswerRe: Query required Pin
John-ph3-Oct-07 23:33
John-ph3-Oct-07 23:33 
GeneralRe: Query required Pin
veereshIndia3-Oct-07 23:35
veereshIndia3-Oct-07 23:35 
GeneralRe: Query required Pin
John-ph4-Oct-07 0:05
John-ph4-Oct-07 0:05 
GeneralRe: Query required Pin
Krish - KP4-Oct-07 0:30
Krish - KP4-Oct-07 0:30 
GeneralRe: Query required Pin
John-ph4-Oct-07 0:41
John-ph4-Oct-07 0:41 
AnswerRe: Query required Pin
Krish - KP4-Oct-07 0:28
Krish - KP4-Oct-07 0:28 
GeneralRe: Query required Pin
John-ph4-Oct-07 0:38
John-ph4-Oct-07 0:38 
AnswerRe: Query required Pin
Paddy Boyd4-Oct-07 0:35
Paddy Boyd4-Oct-07 0:35 
GeneralRe: Query required Pin
John-ph4-Oct-07 0:44
John-ph4-Oct-07 0:44 
GeneralRe: Query required Pin
Paddy Boyd4-Oct-07 0:46
Paddy Boyd4-Oct-07 0:46 
GeneralRe: Query required Pin
veereshIndia4-Oct-07 1:09
veereshIndia4-Oct-07 1:09 
GeneralRe: Query required Pin
Paddy Boyd4-Oct-07 1:14
Paddy Boyd4-Oct-07 1:14 
GeneralRe: Query required Pin
veereshIndia4-Oct-07 1:27
veereshIndia4-Oct-07 1:27 

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.