ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Freeform date question

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

  • Freeform date question

    I am running V5R2 and have a freeform date question.
    I have a field that is defined as a date field (Date_Iso).
    I want to move it into our 9.0 numeric data field.
    Because of V5R2 I use the following code:
    Lioidt = %Dec(%Char(Date_Iso):9:0);

    However, I get an error message:
    "A character representation of a numeric value is in error"
    Debug shows me that Date_Iso contains '2005-07-10'

    Can anyone provide assistance?
    Thanks,

  • #2
    Re: Freeform date question

    Originally posted by Iwana
    I am running V5R2 and have a freeform date question.
    I have a field that is defined as a date field (Date_Iso).
    I want to move it into our 9.0 numeric data field.
    Because of V5R2 I use the following code:
    Lioidt = %Dec(%Char(Date_Iso):9:0);

    However, I get an error message:
    "A character representation of a numeric value is in error"
    Debug shows me that Date_Iso contains '2005-07-10'

    Can anyone provide assistance?
    Thanks,

    Try this:

    Lioidt = %Dec(%Char(Date_Iso:*iso0):9:0);

    Let me know if it works!

    Michael
    "Time passes, but sometimes it beats the <crap> out of you as it goes."

    Comment


    • #3
      Re: Freeform date question

      I know sometimes Im a bit slow.....
      Why do you have date fields defined as 9,0 decimal.

      Thanks
      Jamie
      All my answers were extracted from the "Big Dummy's Guide to the As400"
      and I take no responsibility for any of them.

      www.code400.com

      Comment

      Working...
      X