Using Date Cell Type in a BR

GregHertling
New Contributor III

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

1 ACCEPTED SOLUTION

JackLacava
Community Manager
Community Manager

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)

View solution in original post

3 REPLIES 3

JackLacava
Community Manager
Community Manager

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
Contributor III

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

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.