SQL for Current Year Starting and ending dates

Database
Enthusiast

SQL for Current Year Starting and ending dates

All,

I am looking for a SQL that gives the current year starting and ending dates. i.e.., 01/01/2013 & 12/31/2013

1 REPLY
Enthusiast

Re: SQL for Current Year Starting and ending dates

The most readable solution for me would probably be this:

select

    cast( trim( extract( year from current_date ) ) || '-01-01' as DATE )

        as first_day_of_year,

    cast( trim( extract( year from current_date ) ) || '-12-31' as DATE )

        as last_day_of_year;