Graphics

 View Only
  • 1.  Converting Date into Age

    Posted 01-18-2019 16:50
    Hi,

    I have a data feed for a birth date that is coming in in the format of YYYY-MM-DD and I was wondering what the best way would be to turn this string into a person's age.

    Any help would be appreciated.


  • 2.  RE: Converting Date into Age

    Posted 01-18-2019 17:01
    Someone might be able to post a full example of visual logic/scripting but the way I would start tackling this problem would be to try and re-create this formula in visual logic:
    https://www.youtube.com/watch?v=CcsD2LdVGEc
    #XPression


  • 3.  RE: Converting Date into Age

    Posted 01-18-2019 19:35


  • 4.  RE: Converting Date into Age

    Posted 02-17-2019 21:50
    dim text1, text2, text3 as xpTextObject
    dim Date1, Date2 as Date
    dim i, j as double

    Self.GetObjectByName("Text1", text1)
    Self.GetObjectByName("Text2", text2)
    Self.GetObjectByName("Text3", text3)

    Date1 = text1.text
    Date2 = text2.text

    i = CStr(Date1.Subtract(Date2).Days / 365.25)

    j = CInt(Math.Truncate(i))

    text3.text = j

    #XPression


  • 5.  RE: Converting Date into Age

    Posted 02-17-2019 23:06

    Here a VisualLogic solution


    #XPression