title: error problem with 1582 Incorrect parameter count in the call to native function 'ISNULL'
body: <p>i have 2 tables one (visits) and other one (patients) with relationship by mysql (patients) is with PK as patients.pid and visits.pid as index 
  and i wanted to use code in my vb.net app to get the last datetime record to check the patient if still inside the hospital admitted or discharge
  so far i have this code with help of you guys</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>SELECT a.pid,MAX(ISNULL(b.sdat,'1901-01-01')),MAX(ISNULL(b.edat,'1901-01-01')) from patients a left join visits b on a.pid=b.pid Where ddatediff(now(),b.edat) &lt;=365 group by a.pid</code></pre>
  </div>
  </div>
  </p>
  
  <p>but when i execute in sql builder using php myadmin  or another app i get error 
  (1582 - Incorrect parameter count in the call to native function 'ISNULL') 
  i tried to find out the error cause but no luck until now</p>