In the image below, the highlighted line of text is what is causing the problems
Basically, what I want to do in this query is return the "DeptEstEnd" (which is a date) AS "Capacity End Date" when this date in the query is greater than or equal to the current date. If this field is blank, or in the past then I want the greater of the "Dock Date" , "Due Date" , or "Current Date" to be returned as "Capacity End Date"
Any ideas as to why this is failing? Any suggestions?
if(to_integer(dat_diff("DeptEstEnd",current_date())) > 0,"DeptEstEnd", find_max_value("Dock Date", "Due Date", current_date())) AS "Capacity End Date",