ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

zeros/blanks as default value for Date field

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

  • zeros/blanks as default value for Date field

    Hi,

    i have a date field in my PF:
    A CVDOB L COLHDG('DATE OF BIRTH')
    A DATFMT(*USA)

    my problem is when i populate this field i dont want any default value in it if there is no data to be stored.

    the value defaults to :

    DATE OF BIRTH

    01/01/0001
    01/01/0001
    01/01/0001

    i want blanks or zeros instead of the above values. is there a way to do that?

    Thanks in Adv.
    Regards,
    Ruma

  • #2
    Re: zeros/blanks as default value for Date field

    Hi

    Use keyword MAPVAL(('01.01.0001' *BLANK))

    LP Zdenko
    LP Zdenko

    Comment


    • #3
      Re: zeros/blanks as default value for Date field

      thanks Zdenko.

      but mine is not a display file. i guess MAPVAL can only be used on display files.
      when i execute a RUNQRY command it shows me 01/01/0001 but i want blanks there. is it possible?

      TIA
      Regards,
      Ruma

      Comment


      • #4
        Re: zeros/blanks as default value for Date field

        Hi

        Yes that keyword is valid only for DSPF.
        If I run RUNQRY over file that contains empty date fields,
        got the same results like You.
        Sorry.


        LP Zdenko
        LP Zdenko

        Comment


        • #5
          Re: zeros/blanks as default value for Date field

          A zero is invalid for a date field. the default is *LOVAL which amount to 01/01/0001 or 01/01/40 depending on format.

          Comment


          • #6
            Re: zeros/blanks as default value for Date field

            thanks Arrow and thanks Zdenko !
            Regards,
            Ruma

            Comment

            Working...
            X