error problem with 1582 Incorrect parameter count in the call to native function 'ISNULL' [closed]

MySQL's ISNULL() is a comparison function, that takes a single argument and returns 1 if it is NULL. I think that you meant IFNULL() - or the more standard COALESCE().

I would also suggest moving the check outside of the aggregate function, for better efficiency:

COALESCE(MAX(b.sdat),'1901-01-01'),
COALESCE(MAX(b.edat),'1901-01-01')