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
Unconfigured Ad Widget
Collapse
Announcement
Collapse
No announcement yet.
Pros and Cons of defining date fields as date type fields in PF
Collapse
X
-
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
-
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
Comment