carpetbelly
Technical User
I'm trying to create a query. I have a field called 'HalfDay' that's a Yes/No. I also have another field that works out how many working days between dates there are. What I am trying to do is when the Yes/No field is set to true how I can default the working day field to 0.5.
Below is the SQL I thought would work and the code I seem to be getting an error with...
Below is the SQL I thought would work and the code I seem to be getting an error with...
Code:
SELECT
tblStaff.StaffName
, tblHoliday.StartDate
, tblHoliday.EndDate
, CASE
when tblHoliday.HalfDay= 1 then "0.5"
when tblHoliday.HalfDay = 0 then myCalcHolDays([StartDate],[EndDate])
END as days
FROM
tblStaff
INNER JOIN
tblHoliday
ON tblStaff.StaffID = tblHoliday.StaffID
;