Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2009
    Posts
    2

    Unhappy Unanswered: Problem with Date Format , ISO

    Hi friends ,

    I'm new to this forum adn to DB2 ... i'm on the verge of writing a script to automate some process .... i face problem in converting a date format to ISO from USA(default in my production box).
    Given below is my script ...
    ----------------------------------------------------
    day1=`$db2 -x "values current date"`
    day2=`$db2 -x "values (current date) - 1 day"`
    day3=`$db2 -x "values (current date) - 2 days"`
    day4=`$db2 -x "values (current date) - 3 days"`
    day5=`$db2 -x "values (current date) - 4 days"`
    ----------------------------------------------------

    I need to get these output dates in ISO format (yyyy-mm-dd) ...

    Somebody pls help me in getting the same....

  2. #2
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    CHAR(date-expression, ISO)

  3. #3
    Join Date
    Jun 2009
    Posts
    2
    ton ,

    are u asking me to have my date function like

    "day1=`$db2 -x "CHAR(current date,ISO)"`
    "day2=`$db2 -x "CHAR(day1) - 1 day"`

  4. #4
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    From
    day2=`$db2 -x "values (current date) - 1 day"`

    to
    day2=`$db2 -x "values CHAR(current date - 1 day, ISO)"`

Posting Permissions

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