title: Snowflake SQL: Get Last Day of Month Records
body: <p>Where one would normally use EOMonth, in Snowflake there is no such function. They have LAST_DAY, but so far I have not been able to get that one to work neither. Does anyone see what I have done incorrectly below <strong>OR</strong> have a workaround to EOMonth in Snowflake?</p>
  
  <p>My attempts:</p>
  
  <pre><code>SELECT *
  FROM "NORCO"."UNITS_SNAPSHOT" AS US1
  WHERE US1.CCODE LIKE '%514-L%' AND 
  US1.TIMESTAMP=(SELECT LAST_DAY(US1.TIMESTAMP,'MONTH') 
                 FROM "NORCO"."UNITS_SNAPSHOT" AS US2 WHERE US1.CCODE=US2.CCODE)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>SELECT *
  FROM "NORCO"."UNITS_SNAPSHOT" AS US1
  WHERE US1.CCODE LIKE '%514-L%' AND 
  US1.TIMESTAMP=LAST_DAY(US1.TIMESTAMP,'MONTH')
  </code></pre>
  
  <p>What I expect for the return from the daily records table is the last day of month records. Suggestions, help or ideas are appreciated!!</p>
  
  <p>Thanks all</p>