You are on page 1of 1

SELECT

--act."Day Off Rest Act",


c.code AbsenceCode,
c.Description ,
prs."Employee Name",
CAST((act."KID - date") AS datetime) as DutyDate,

replace(prs."Employee Number",' ','') as EPN,


null as STAGE_STATUS

from "CREW DUTY" act inner join PERSONNEL prs on prs."Employee ID" = act."Employee
ID"
inner join Codes C on act."Activity Type"=c.Value and c.name = 'act_type____'

where c.name = 'act_type____'


and c.code in ('SR','SD','DS','RE')
--and (c.code not IN ('1'))
--and replace(prs."Employee Number",' ','') = '46012'
--and (CAST((act."KID - date") AS datetime) between '2023-12-01 00:00:00' and
'2023-12-31 23:59:59'
--or CAST((act."KID - time") AS datetime) between '2023-12-01 00:00:00' and '2023-
12-31 23:59:59'
--or CAST((act."KID - mult") AS datetime) between '2023-12-01 00:00:00' and '2023-
12-31 23:59:59')

--and (act."Act Begin Date Home" is not null and act."Act Begin Date Home" <> 0)
--and (act."Day Off Rest Act" is not null )
--and (act."Cancelled" is not null and act."Cancelled" =0)
--and (act."Employee ID" is not null and act."Employee ID" <> '')

group by c.code ,
c.Description ,
prs."Employee Name",
CAST((act."KID - date") AS datetime),
replace(prs."Employee Number",' ','')

order by CAST((act."KID - date") AS datetime) desc

jdbc:pervasive://RUH-FS01:1583/FOSREPORTS?transport=tcp

You might also like