Hello,
This is most likely going to be the silliest thread in this forum- but for the life of me, I cannot see what is causing a 'syntax error- missing operator' error in this query. All the table and field names are correct, as far as I can tell all the commas are in place and I just checked the placement of all the parentheses for the hundredth time. I can't see anything wrong with the syntax. Would someone please be able to take an objective look at this query and let me know if they spot anything off in the syntax?
I normally refrain from posting about simple syntax errors because they should really be resolved independently, but I've been staring at this code for so long now, I feel like I need an outside view to help me out. Thank you so much!
This is most likely going to be the silliest thread in this forum- but for the life of me, I cannot see what is causing a 'syntax error- missing operator' error in this query. All the table and field names are correct, as far as I can tell all the commas are in place and I just checked the placement of all the parentheses for the hundredth time. I can't see anything wrong with the syntax. Would someone please be able to take an objective look at this query and let me know if they spot anything off in the syntax?
I normally refrain from posting about simple syntax errors because they should really be resolved independently, but I've been staring at this code for so long now, I feel like I need an outside view to help me out. Thank you so much!
PHP:
SELECT LastName, FirstName, max(RoleStartDate) AS MaxRoleStartDate, LeaveStartDate, LeaveEndDate
FROM (Select * from EMPLOYEE_REG
WHERE
((EMPLOYEE_REG.RegStartDate is Null Or len(employee_REG.regstartdate)=0 Or EMPLOYEE_REG.RegStartDate<=[end date]))
And
((EMPLOYEE_REG.EndDate is Null Or len(employee_REG.enddate)=0 Or EMPLOYEE_REG.EndDate>= [start date]))
and
(
( (leavestartdate is null or len(leavestartdate)= 0) and (leaveenddate is null or len(leaveenddate)=0) )
or
(leaveenddate<= [start date])
or
(leavestartdate>=[end date])
or
(leavestartdate betweeen [start date] and [end date])
or
(leaveenddate between [start date] and [end date])
)
and
(rolestartdate<= [end date] or rolestartdate is null or len(rolestartdate)= 0)
)
GROUP BY LastName, FirstName, LeaveStartDate, LeaveEndDate
ORDER BY lastname, firstname;