SELECT DATE_TRUNC('month', DATE('17/01/1997') + '1 month') - '1 day'
Is there a more efficient way to get the last day of the month for any
I searched all over google for answers to this question and came across many
solutions. But converting dates to character and plugging a "01" in and
putting the date back together seemed to old school.
Or maybe it had a different purpose that I didn't catch in the thread. But
tinkering with Healthcare data has caused me to tinker with dates more than
I could care for.
I figure I would just post this incase someone else needed a simple solution
that didn't eat up the runtime of the query.
/*CurrentMonth is set to the first day of the month*/
/*Figure out the last day of the current month */
/*Figure out the last day of the previous month */
Not to mention storing all of these little bits of code in the newsgroup
allows me to find them in the future from anywhere.
5. end of month