Results 1 to 4 of 4

Thread: Date diff

  1. #1
    Join Date
    Feb 2005
    Posts
    5

    Question Unanswered: Date diff

    How do I determine the difference between two dates in informix. I need to be able to find the days, months, and years between.
    Also, is there a date format method like in oracle where it will display the date with whatever params I want?

  2. #2
    Join Date
    Mar 2004
    Location
    Netherlands
    Posts
    183

    Wink

    Hi,

    First question:
    Just substract the dates. This will give the difference in days.

    Secon question:
    Yes, the TO_CHAR function. Check the manual or internet for all possibilities

    Greetz,

    Rob

  3. #3
    Join Date
    Feb 2005
    Posts
    5

    Months

    But what about months? Since months have different numbers of days, how I can I precisely meause the difference in months?

  4. #4
    Join Date
    Mar 2004
    Location
    Netherlands
    Posts
    183
    Indeed,

    What about months, that can be different every time. Thats why it is not specified. If you want to do this you have to do it manually in an SPL. This is possible by breaking down the date field and do the calculation yourself.

    In financial system they just divide it normally by thirty. They also assume a year has 360 days.

    Greetz,

    Rob

Posting Permissions

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