We are currently working on the forum. For the short-term, all forum content will be in read-only format. We apologize for the interruption and look forward to collaborating with you shortly. All the best in your research!

calculate days

Hi all,
we use OpenClinica 3.0.3 ,I need help with fun "regexp" to calculate days between two date,
for example:
when enter start date : 13/9/2011 and end date :15/9/2011
the duration will be: 2 days , I need expression to do that.

any help be appreciated.

Comments

  • Hi all,
    we use OpenClinica 3.0.3 ,I need help with fun "regexp" to calculate days between two date,
    for example:
    when enter start date : 13/9/2011 and end date :15/9/2011
    the duration will be: 2 days , I need expression to do that.

    any help be appreciated.
  • GerbenRienkGerbenRienk Posts: 838 ✭✭✭
    Hello Maryam,
    Unfortunately it is not possible to do such a thing in OC 3.0.3:
    calculated fields only work when numeric fields are used for the
    calculation.
    (In 3.1 you can write a rule with an InsertAction and put the result of
    whatever calculation in a field on your CRF.)
    What is it exactly that you want with the outcome of the duration? If you
    need it for a validation: you can calculate with dates in expressions
    (although only in days).
    Kind regards,
    Gerben Rienk
    http://www.trialdatasolutions.com
    > > Hi all,
    > >
    > > we use OpenClinica 3.0.3 ,I need help with fun "regexp" to calculate days
    > > between two date,
    > >
    > > for example:
    > >
    > > when enter start date : 13/9/2011 and end date :15/9/2011
    > >
    > > the duration will be: 2 days , I need expression to do that.
    > >
    > >
    > > any help be appreciated.
    > >
    > >
  • agoodwinagoodwin Posts: 131 admin
    Hello,

    Regular expressions to not make calculations. Regular expressions will validate that a user-input value meet a specific format. Additionally, Regular expressions are not checking against any system variables.
    It sounds like what you are trying to accomplish would best be handles with a rule. For more information and documentation on rules, please see: https://docs.openclinica.com/3.1/rules .

    Best Regards,
    Alicia
    Sent: Monday, September 19, 2011 7:17 AM
    To: [email protected]; [email protected]
    Cc: [email protected]; [email protected]
    Subject: [Developers] calculate days

    Hi all,
    we use OpenClinica 3.0.3 ,I need help with fun "regexp" to calculate days between two date,
    for example:
    when enter start date : 13/9/2011 and end date :15/9/2011
    the duration will be: 2 days , I need expression to do that.

    any help be appreciated.
This discussion has been closed.