title: Date_Part on SQL Athena - "Function date_part not registered"
body: <p>I'm trying to find latest Sunday (just for the sake of the example)</p>
  <p>In the link below I have found an explanation how to use a date function called date_part to extract the day of week (for example, for current timestamp) and other parts of the date which might be interesting.</p>
  <p><a href="https://docs.aws.amazon.com/redshift/latest/dg/r_DATE_PART_function.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/redshift/latest/dg/r_DATE_PART_function.html</a></p>
  <p>The gist of it:</p>
  <blockquote>
  <p>for example to find day of week</p>
  <p>select date_part(dow, starttime) as dow
  from event</p>
  </blockquote>
  <p>But when I try to run something similar on Athena I receive <strong>&quot;function date_part not registered&quot;</strong>.</p>
  <p>So how can I find the latest Sunday? Or any other day of the week for that matter.</p>