Hello Access Guru's..
I need your help on this quarry...
I have table with the below data
tbl_attend_log
ST_Name ST_Date ST_Attend
Tom 01/01/2014 1
Mat 01/01/2014 1
Jam 01/01/2014 1
Tom 02/01/2014 2
Mat 02/01/2014 1
Jam 02/01/2014 3
Tom 03/01/2014 1
Mat 03/01/2014 2
Jam 03/01/2014 1
ST_attend column values represents as below
1 = OnDuty
2 = AnnualLeave
3 = DutyTravel
when I give a date range I need to quarry to display as below..
"ST_Name" "OnDuty" "AnnualLeave" "DutyTravel"
Tom 2 1 0
Mat 2 1 0
Jam 2 0 1
I manage to wright a quarry as below
SELECT tbl_attend_log.ST_Name, Count(tbl_attend_log.ST_Attend) AS OnDuty
FROM tbl_attend_log
WHERE (((tbl_attend_log.ST_Date) Between #01/04/2014# And #30/04/2014#) AND ((tbl_attend_log.ST_Attend) Like '1'))
GROUP BY tbl_attend_log.ST_Name;
Output
ST_Name OnDuty
Tom 2
Mat 2
Jam 2
How can I add other columns and criteria’s ?
I need your help on this quarry...
I have table with the below data
tbl_attend_log
ST_Name ST_Date ST_Attend
Tom 01/01/2014 1
Mat 01/01/2014 1
Jam 01/01/2014 1
Tom 02/01/2014 2
Mat 02/01/2014 1
Jam 02/01/2014 3
Tom 03/01/2014 1
Mat 03/01/2014 2
Jam 03/01/2014 1
ST_attend column values represents as below
1 = OnDuty
2 = AnnualLeave
3 = DutyTravel
when I give a date range I need to quarry to display as below..
"ST_Name" "OnDuty" "AnnualLeave" "DutyTravel"
Tom 2 1 0
Mat 2 1 0
Jam 2 0 1
I manage to wright a quarry as below
SELECT tbl_attend_log.ST_Name, Count(tbl_attend_log.ST_Attend) AS OnDuty
FROM tbl_attend_log
WHERE (((tbl_attend_log.ST_Date) Between #01/04/2014# And #30/04/2014#) AND ((tbl_attend_log.ST_Attend) Like '1'))
GROUP BY tbl_attend_log.ST_Name;
Output
ST_Name OnDuty
Tom 2
Mat 2
Jam 2
How can I add other columns and criteria’s ?
Last edited: