Announcement

Announcement Module
Collapse
No announcement yet.

Pros and Cons of defining date fields as date type fields in PF

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Pros and Cons of defining date fields as date type fields in PF

    On all new files/tables I create, I've been using date or timestamp types - much easier to deal with when using SQL, and you don't have to convert the numerics when want to use date logic in RPGIV. IMHO

  • #2
    Pros and Cons of defining date fields as date type fields in PF

    Thank you for your input. Using date type fields is what I would like to do but just wondered if anyone had run into any problems.

    Comment


    • #3
      Pros and Cons of defining date fields as date type fields in PF

      If using a date type field in a pf, and this field is populated by entering data through a display file, will the user have to enter the separators (for ISO) for the date?

      Comment


      • #4
        Pros and Cons of defining date fields as date type fields in PF

        Don't use native date fields on a display file. The user will be *forced* to enter valid dates even when they just want to simply exit out of the screen. It's better (in my opinon) to convert the date to a number for display file purposes. Chris
        Code

        Comment


        • #5
          Pros and Cons of defining date fields as date type fields in PF

          I am not sure whether to define date fields as date type or numeric. Does anyone have any suggestions?

          Comment


          • #6
            Pros and Cons of defining date fields as date type fields in PF

            Using the DATFMT and MAPVAL key words in the display file will allow dates to be displayed as blank fields if they contain the default value. If the user does key in the date, the system will validate it for you for correctness. In my example, StuBdt contains 090605. The Eval statement allows it to be displayed as 09/05/2005. If this date is invalid, '01/01/0001' is moved to the field and it displays as blanks.
            Code

            Comment

            Working...
            X