Results 1 to 3 of 3

Thread: DateDiff help

  1. #1
    Join Date
    Nov 2011

    Unanswered: DateDiff help

    Good morning,

    I have a query where I pull a Julian date from a database: MYDATE
    Then get TodaysDate using (current date)

    SELECT MYDATE, (current date) As TodaysDate FROM LIBRARY.FILE

    I need to get the difference of the two in days. How would I do it in my SELECT statement ?

    I can convert the Julian date (MYDATE) to a date or a string that represents a be honest I am not sure what is being returned, but I use a Date Translation File to get it. My Date translation file has a FIELD TYPE of A.

    It's obvious I am new to DB2. Please help a Newbie


  2. #2
    Join Date
    Nov 2011

    DateDiff help - update

    My Date Translation file is returning the date in a format like this:


    If I can convert 09/10/11 into a format like this 09/10/2011 then I can make it work. How can I make this conversion ?


  3. #3
    Join Date
    Jan 2003
    Provided Answers: 5
    What is the data type of MYDATE? What DB2 version and OS are you using?


Posting Permissions

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