Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2007
    Posts
    265

    Unanswered: Return current year in db2 ( with only last two digits)

    Hi,

    If I give this command, I get the full year returned..

    db2 "select YEAR( CURRENT DATE) from sysibm.sysdummy1"

    1
    -----------
    2011

    1 record(s) selected.


    Is there a function or a way to only return the last two digits.. for example in the above query, I only want '11' returned to me not 2011. Thanks!

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Tried MOD(YEAR( CURRENT DATE),100) ?

    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    Nov 2007
    Posts
    265
    excellent, thank you!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •