How to use DATE_TRUNC

You can Date functions in your project. This post is to convert to numeric Date.

DATE_TRUNC ( PERIODIC_DATE, YEAR)

The TRUNC function truncates DATE to year. The input DATE is YYYY-MM-DD. After TRUNC function, it changes to YEAR. That means to YYYY-01-01.

Uses of DATE_TRUNC Function

  • This function most frequently being used in data warehousing projects.
  • This is one of the best way to work with Date related functions.

References

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.