Click here to Skip to main content
15,905,232 members
Home / Discussions / Database
   

Database

 
AnswerRe: audit trail Pin
N a v a n e e t h2-Feb-09 19:06
N a v a n e e t h2-Feb-09 19:06 
GeneralRe: audit trail Pin
NidhiKanu2-Feb-09 19:18
professionalNidhiKanu2-Feb-09 19:18 
QuestionSQL For selecting consecutive rows with time difference Pin
pratap19802-Feb-09 13:11
pratap19802-Feb-09 13:11 
AnswerRe: SQL For selecting consecutive rows with time difference Pin
Wendelius2-Feb-09 18:19
mentorWendelius2-Feb-09 18:19 
Questioncount total records and (number of records based on a condition) for same column in single sql query Pin
chandrubngit2-Feb-09 5:28
chandrubngit2-Feb-09 5:28 
AnswerRe: count total records and (number of records based on a condition) for same column in single sql query Pin
Colin Angus Mackay2-Feb-09 5:52
Colin Angus Mackay2-Feb-09 5:52 
GeneralRe: count total records and (number of records based on a condition) for same column in single sql query Pin
Wendelius2-Feb-09 6:13
mentorWendelius2-Feb-09 6:13 
AnswerRe: count total records and (number of records based on a condition) for same column in single sql query Pin
Wendelius2-Feb-09 6:13
mentorWendelius2-Feb-09 6:13 
Not sure if Access accepts this, but have a try:
SELECT Employee_ID, 
       Employee_Name, 
       count (*) as [Total Days],
       (SELECT COUNT(*)
        FROM EmpTable e2
        WHERE e2.Employee_Name = e1.Employee_Name
        AND   Attendance_Date  BETWEEN ? AND ?
        AND   e2.Status        = 'P')
From EmpTable e1
Where Employee_Name   = ?
and   Attendance_Date between ? and ?
group by Employee_ID, 
         Employee_Name

Note, literals are replaced by parameters (read Colin's post).

The need to optimize rises from a bad design.My articles[^]

GeneralRe: count total records and (number of records based on a condition) for same column in single sql query Pin
chandrubngit18-Feb-09 23:51
chandrubngit18-Feb-09 23:51 
GeneralRe: count total records and (number of records based on a condition) for same column in single sql query Pin
Wendelius19-Feb-09 5:54
mentorWendelius19-Feb-09 5:54 
QuestionRun single instance of an application Pin
ashok_rgm2-Feb-09 2:22
ashok_rgm2-Feb-09 2:22 
AnswerRe: Run single instance of an application Pin
Wendelius2-Feb-09 3:01
mentorWendelius2-Feb-09 3:01 
AnswerRe: Run single instance of an application Pin
Colin Angus Mackay2-Feb-09 3:02
Colin Angus Mackay2-Feb-09 3:02 
GeneralRe: Run single instance of an application Pin
ashok_rgm2-Feb-09 22:20
ashok_rgm2-Feb-09 22:20 
Questionmcd and history table Pin
foryou2-Feb-09 1:49
foryou2-Feb-09 1:49 
AnswerRe: mcd and history table Pin
Paddy Boyd2-Feb-09 2:03
Paddy Boyd2-Feb-09 2:03 
AnswerRe: mcd and history table Pin
Colin Angus Mackay2-Feb-09 2:18
Colin Angus Mackay2-Feb-09 2:18 
GeneralRe: mcd and history table Pin
foryou2-Feb-09 2:58
foryou2-Feb-09 2:58 
QuestionRe: mcd and history table Pin
foryou2-Feb-09 23:24
foryou2-Feb-09 23:24 
QuestionMS-ACCESS combofilling [modified] Pin
ketan bader1-Feb-09 20:02
ketan bader1-Feb-09 20:02 
AnswerRe: MS-ACCESS combofilling Pin
Vimalsoft(Pty) Ltd1-Feb-09 23:06
professionalVimalsoft(Pty) Ltd1-Feb-09 23:06 
AnswerRe: MS-ACCESS combofilling Pin
Blue_Boy1-Feb-09 23:09
Blue_Boy1-Feb-09 23:09 
Questionquery with aggregate Pin
rm_suprapto1-Feb-09 18:02
rm_suprapto1-Feb-09 18:02 
AnswerRe: query with aggregate Pin
Wendelius1-Feb-09 18:08
mentorWendelius1-Feb-09 18:08 
GeneralRe: query with aggregate Pin
rm_suprapto1-Feb-09 23:58
rm_suprapto1-Feb-09 23:58 

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.