title: how to confirm dates are valid in google big query
body: <p>I have a Birthdate field that has YYYY-MM-DD in it.</p>
  
  <p>I'm using the below statement:</p>
  
  <pre><code>select 
    farm_fingerprint(cast(P.Key as string)) as person_id 
    , EXTRACT(YEAR from P.BirthDate) as year_of_birth
    , EXTRACT(MONTH from P.BirthDate) as month_of_birth
    , EXTRACT(DAY from P.BirthDate) as day_of_birth
    , DATETIME(TIMESTAMP (CONCAT(CAST(P.BirthDate as string), ' 00:00:00')))
    , P.Birthdate
  from person P;
  </code></pre>
  
  <p>my question is about the BirthDate Field.  How do I ensure that this is a valid date prior to conversion?</p>
  
  <p>If the value is bad, EXTRACT() will fail.  Does COALESCE() work on failed functions? if not, how do I compensate and set null?</p>
  
  <p>Thanks</p>