What are the units for the Date Difference function?

Home Forum Behaviors What are the units for the Date Difference function?

This topic contains 4 replies, has 0 voices, and was last updated by  ehuezo 7 years, 9 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #84

    ehuezo
    Keymaster

    The units for the date difference function are as follows:

    y – years

    l – months

    w – weeks

    d – days

    wd – working days

    h – hours

    m – minutes

    s – seconds

    If you have two date fields, or two time fields, you can use the Date Difference function to return the difference based on the value of the units. So, for example, if you had a start and end (time/date), To calculate the difference using the Date Difference function, you would enter the End (date/time) as the first value, the Start (date/time) as the second value, and the corresponding unit in which you wish to calculate the results in.

    #4401

    Anonymous

    Is there a way to merge the date and time fields together? I need to calculate the difference between a specific start date and time with that of another.

    Example:

    An employee’s shift could start on 03/05/2009 06:30:00 PM and end on 03/06/2009 05:30:00 AM

    I need to be able to calculate the # of hours the employee worked, which in this scenario would be 11 hours.

    Charles

    #4402

    ehuezo
    Keymaster

    Hi Charles,

    I have a sample form which demonstrates this type of calculation. I’m going to send it to you shortly.

    Ray

    #5613

    evelina.liu
    Participant

    I have a question regarding date calculation – how should I calculate whether or not an entered date falls within this current fiscal year (from 9/1 to 8/31).

    So far I have a good structure in arranging my elements for this calculation, but I am unable to figure out how to accomplish “year + 1” or “year – 1”. Not sure if there is any related function for this, or if I miss anything.

    Below is my current logic:

    Determine current fiscal year (f_year):

    If month(today) >= 9 then f_year = year(today)

    If month(today) < 9 then f_year = (year(today) – 1)

    Determine if the entered date falls within this current fiscal year:

    Check If ( (month(entered_date) >= 9) & (year(entered_date) = f_year) )

    OR

    ( (month(entered_date) < 9) & (year(entered_date) = (f_year + 1) )

    Thanks.

    #5616

    I have built a sample form to demonstrate the behaviors. I will email it to you.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.