compare dates in yymm format

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • juan ortiz
    New Member
    • Jun 2008
    • 1

    compare dates in yymm format

    DB2

    Two dates in a DB2 table with regular yyyy-mm-dd format

    I want format DATE1 as yymm (when you show me how to do it)
    to compare DATE1 to DATE2 ( will also format this 2nd date as yymm)
    Thanks
    Juan
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Read this article especially the "Custom Date/Time formatting" section.
    After that try it and post again if you still get problems.

    Comment

    • niladri123
      New Member
      • Dec 2007
      • 8

      #3
      u can try

      create distinct type date1 as integer with comparisons

      tab2 col1 (date1)

      select * from tab1 inner join tab2 on tab1.date1(col1 ) = tab2.col1

      Comment

      Working...