Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

*ISO date format and STRSQL

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • *ISO date format and STRSQL

    Ken, Dates outside of the range 1940/01/01 - 2039/12/31, will not appear correctly formatted unless you wrap the CHAR(date,USA) function around them. You don't have to use teh USA format, that is jsut an example. ISO, and others work as well.
    Code

  • #2
    *ISO date format and STRSQL

    I'm not sure why the DATFMT keyword doesn't work. We're on V5R2 and I get the same results as you do. However, once you have a session started you can use F13, then 1. Change session attributes, and change the date format there.

    Comment


    • #3
      *ISO date format and STRSQL

      The DATFMT in your saved SQL session is overiding the STRSQL parameter. You probaly see a "STRSQL parameters were ignored." message when starting the session. Use F13 to change your settings, and save the session when exiting.

      Comment


      • #4
        *ISO date format and STRSQL

        I have a file with a DATE field that has *ISO format, according to DSPFFD. It has a far-future value of 12/31/2200, used to indicate "forever". When I use interactive SQL, I cannot view it, even when I do STRSQL DATFMT(*ISO); it appears as ++++++++. Dates in the usual 100-year window appear OK. I am doing 'SELECT * FROM MyFile'. Is there something I'm missing here? I'm still not too familiar with SQL/400. We're at V5R2, current cume. In the past I've written report programs with the SEQUEL product and CL; learning SQL/400 has been like learning to write with my off hand. Not a bad experience, but slow with occasional frustrations.

        Comment


        • #5
          *ISO date format and STRSQL

          Lennon's solution works, and Paul Swain's response gets to the root of the problem. I hadn't noticed the "STRSQL parameters ignored", but it's there. kforsythe, your solution works too, but the resulting field is CHAR, not DATE, and I sometimes need the latter. Much thanks to all who responded!

          Comment

          Working...
          X