I have opened a connection to an Access database and am running a query but the IF statement seems to be causing a problem and I can’t see what it is. If the statement is true then col3, if it is false then I want which every number is bigger from either col6 or col7.
qry2=(“select col1, col2, col3, if(col4 < 1 OR col5 IS NOT NULL, col3, GREATEST(MAX(col6), MAX(col7))) as testcoldata from mytable”)
I get the error “Undefined function ‘if’ in expression.” If anyone could point me in the right direction. Thanks!