Monday, 11 February 2013

Oracle First day of given month or given year.

I noticed trunc has a skillful way of working with dates.

First day of the month :
select trunc(sysdate,'MM') from dual;
Gives me 01-FEB-13

First day of the year:
select trunc(sysdate,'YY') from dual;
Gives me 01-JAN-13

No comments:

Post a Comment

Integrations Lead - Lessons learnt

 Integrations have been my passion for a while but like anything tech there is no credit given when things go right but always heaps of pres...