All Forums Database
siva1987 2 posts Joined 02/15
16 Feb 2015
How to generate a particular date in a year

I was working on a SQL script and there will be 2 date fields let's say start date and end date. The start date should be may 31st of this year and end date should be April 30th of next year. How to do this?

dnoeth 4628 posts Joined 11/04
16 Feb 2015
cast(extract(year from current_date) || '-05-31' as date)
cast(extract(year from add_months(current_date,12)) || '-04-30' as date)

 

Dieter

siva1987 2 posts Joined 02/15
17 Feb 2015

Thank You. you are the best.

You must sign in to leave a comment.