Forum Discussion

GregHertling's avatar
GregHertling
New Contributor III
2 years ago

Using Date Cell Type in a BR

Hi, I have a CV Form where the input is a "Date" Cell Type.  I need to use the date to translate to a OS Time Period.  I am struggling with using the Date value in a Business Rule.  It only returns an Integer and I can't seem to convert the integer to a Date in the BR so I can grab the Year (Dim strYear As String = Date.ToString("yyyy")).  Any help with this?

thanks,

Greg

  • If I remember correctly, that integer is the number of ticks - so you just pass it to the constructor to get a DateTime object back, i.e.

    Dim myDate as new DateTime(yourNumber)
  • JackLacava's avatar
    JackLacava
    Honored Contributor

    If I remember correctly, that integer is the number of ticks - so you just pass it to the constructor to get a DateTime object back, i.e.

    Dim myDate as new DateTime(yourNumber)
  • db_pdx's avatar
    db_pdx
    Valued Contributor

    And after getting a real DateTime object, you can use: myDate.Year.ToString  to get the year as a string type.

    • GregHertling's avatar
      GregHertling
      New Contributor III

      thanks everyone.  I was finally able to get this to work.  FYI, I had to use (Dim yournumber As Long) to be able to use the integer.  As Integer errored out on me.