Table of Contents

Search

  1. Preface
  2. The Transformation Language
  3. Constants
  4. Operators
  5. Variables
  6. Dates
  7. Functions
  8. Creating Custom Functions
  9. Custom Function API Reference

Transformation Language Reference

Transformation Language Reference

Difference Between the YY and RR Format Strings

Difference Between the YY and RR Format Strings

PowerCenter
also provides a YY format string. Both the RR and YY format strings specify two-digit years. The YY and RR format strings produce identical results when used with all date functions except TO_DATE. In TO_DATE expressions, RR and YY produce different results.
The following table shows the different results each format string returns:
String
Current Year
TO_DATE(String, ‘MM/DD/RR’)
TO_DATE(String, ‘MM/DD/YY’)
04/12/98
1998
04/12/1998 00:00:00.000000000
04/12/1998 00:00:00.000000000
11/09/01
1998
11/09/2001 00:00:00.000000000
11/09/1901 00:00:00.000000000
04/12/98
2003
04/12/1998 00:00:00.000000000
04/12/2098 00:00:00.000000000
11/09/01
2003
11/09/2001 00:00:00.000000000
11/09/2001 00:00:00.000000000
For dates in the year 2000 and beyond, the YY format string produces less meaningful results than the RR format string. Use the RR format string for dates in the twenty-first century.

0 COMMENTS

We’d like to hear from you!