View Single Post
Old 08-18-2019, 01:27 PM   #7
indrajeetpramalik
Newly Registered User
 
Join Date: Aug 2019
Posts: 8
Thanks: 2
Thanked 0 Times in 0 Posts
indrajeetpramalik is on a distinguished road
Re: Leave List as per Date Range

Quote:
Originally Posted by jdraw View Post
Try this (as Tony said results don't match the data supplied)
Code:
SELECT Leave.LeaveAppliedOn
, Leave.LeaveAppliedTill
, Leave.EmployeeName
FROM Leave
ORDER BY Leave.LeaveAppliedOn;

Please define LeaveDate
LeaveAppliedOn and LeaveAppliedTill is DateRange of Leave given to EmployeeName in Table "Leave"

LeaveDate and EmployeeName is to be Generated in query From data in "Leave" Table.. Like:

LeaveDate........EmployeeName
3-Jul-19...........A
4-Jul-19...........A
5-Jul-19...........A
6-Jul-19...........A
4-Jul-19...........B
5-Jul-19...........B
5-Jul-19...........C
6-Jul-19...........C
7-Jul-19...........C
8-Jul-19...........C
10-Jul-19.........A
11-Jul-19.........A
12-Jul-19.........A
13-Jul-19.........A
14-Jul-19.........A
10-Jul-19.........D
11-Jul-19.........D
12-Jul-19.........D
13-Jul-19.........D
14-Jul-19.........D
14-Jul-19.........E
15-Jul-19.........E
16-Jul-19.........E
17-Jul-19.........E
18-Jul-19.........E
15-Jul-19.........B
20-Jul-19.........F


Last edited by indrajeetpramalik; 08-18-2019 at 01:36 PM.
indrajeetpramalik is offline   Reply With Quote