Results 1 to 4 of 4
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Format date 06 in 2006 (2000 sr 1)

    with other object application i get from a screen CICS the value with:

    Sess0.Screen.GetString(LINEA, 112, 2) ' i get two character in this case is 06'

    i would want to format date from 06 in 2006, the problem is when the getstring found 98, 76, or 99... i would want to transform in 1998,1976,19999

    hope i am clear...

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Format date 06 in 2006 (2000 sr 1)

    Say that you use the variable strAnno:

    strAnno = Sess0.Screen.GetString(LINEA, 112, 2)

    You can then convert it as follows:

    If Val(strAnno) < 30 Then
    strAnno = CStr(2000 + Val(strAnno))
    Else
    strAnno = CStr(1900 + Val(strAnno))
    End If

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Format date 06 in 2006 (2000 sr 1)

    Naturally no have WORDS!

    but is required to dim stranno, if yes how to dim stranno?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Format date 06 in 2006 (2000 sr 1)

    If you already have a variable for the year, use that instead of strAnno.
    If you don't:

    Dim strAnno As String

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •