• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Calculate a Fractional Number of Years Difference Between Two Dates in SQL

    October 29, 2008 Hey, Mike

    Is there anything new in SQL that will calculate the difference between two dates and return a fractional number of years? For example: “2007-09-10”–“1997-01-01” should return 10.69 years.

    The normal DB2 SQL function to return a difference between two timestamps (TIMESTAMP_DIFF) will not return fractional values as your calculation requires.

    However, if super accuracy isn’t a great need, there is an easy way to do this. Simply calculate the number of days between the two dates to get the number of days difference. Then divide the result by 365.2425, which is the average number of days in the Gregorian calendar,

    …

    Read more
  • Meaningful Names for Null Indicators

    October 29, 2008 Ted Holt

    There are two ways that a column of a SQL result set can contain the null value. One, it can be derived from an expression that contains a null value. Two, null is returned in outer joins and exception joins when a row in a primary table has no match in a secondary table. In either event, RPG has no way to represent a null value, so what’s a guy (a professional i-on-Power guy, that is) to do when an embedded SQL command might return null values?

    Since RPG variables cannot be null, SQL loads two-byte (five-digit) integer variables with

    …

    Read more
  • Pimp My Font Size, Win a No-Prize

    October 29, 2008 Good-day, Joe

    I have a problem with duplicate 5250 sessions. On our sessions, we change the default screen display font to another font size, such as Courier New. However when we start a second session with the same iSeries Access workstation profile, the screen font reverts back to its default font size: a regular IBM3270 font. What’s going on here and why can’t I use a different font size on multiple sessions?

    –Jean-Pierre

    To solve this problem, I went with my default philosophy for debugging computer issues.

    IF I CAN DUPLICATE IT, I CAN SOLVE IT!!!

    Unfortunately things don’t always work out

    …

    Read more

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • IBM Unveils Manzan, A New Open Source Event Monitor For IBM i
  • Say Goodbye To Downtime: Update Your Database Without Taking Your Business Offline
  • i-Rays Brings Observability To IBM i Performance Problems
  • Another Non-TR “Technology Refresh” Happens With IBM i TR6
  • IBM i PTF Guide, Volume 27, Number 18
  • Will The Turbulent Economy Downdraft IBM Systems Or Lift It?
  • How IBM Improved The Database With IBM i 7.6
  • Rocket Celebrates 35th Anniversary As Private Equity Owner Ponders Sale
  • 50 Acres And A Humanoid Robot With An AI Avatar
  • IBM i PTF Guide, Volume 27, Number 17

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle