Alpha Video Training
Results 1 to 6 of 6

Thread: a5v10 web: Calculated grid fields for duration -(years,Months, days)

  1. #1
    Member
    Real Name
    Isang Udo-Akagha
    Join Date
    Aug 2011
    Location
    Lagos, Nigeria
    Posts
    121

    Default a5v10 web: Calculated grid fields for duration -(years,Months, days)

    Hello all, I have three fields: "Start Date", "End date" and "duration". How do I subtrat the ""start date" from the "end date" field values to calculate the "duration" field values in the format of years, months, days?

    Thank you.

  2. #2
    Member
    Real Name
    Isang Udo-Akagha
    Join Date
    Aug 2011
    Location
    Lagos, Nigeria
    Posts
    121

    Default Re: a5v10 web: Calculated grid fields for duration -(years,Months, days)

    Any body there?

  3. #3
    "Certified" Alphaholic
    Real Name
    Gaby Hernandez
    Join Date
    Sep 2008
    Posts
    1,170

    Default Re: a5v10 web: Calculated grid fields for duration -(years,Months, days)

    Dates must be parsed, try:
    ( Date.parse(startdate) - Date.parse(enddate) ) /86400000 to get the nbr of days between 2 dates.

  4. #4
    Member
    Real Name
    Isang Udo-Akagha
    Join Date
    Aug 2011
    Location
    Lagos, Nigeria
    Posts
    121

    Default Re: a5v10 web: Calculated grid fields for duration -(years,Months, days)

    Thanks Gaby, but I'm sorry it does not work. This functions subtracts the field corrently but it returns the answer in mere figures. I want it returned in Years, Months, days for example 2 years, 1 month, 2 days.

  5. #5
    "Certified" Alphaholic
    Real Name
    Gaby Hernandez
    Join Date
    Sep 2008
    Posts
    1,170

    Default Re: a5v10 web: Calculated grid fields for duration -(years,Months, days)

    A part from the fact that it should be End-Start (I guess you must have caught that), this returns the nbr of days between 2 days (Numerical). If your results are in the hundred of days, there probably is a JS function that can turn a nbr into what you need, otherwise you can build your own expression.

  6. #6
    Member
    Real Name
    Isang Udo-Akagha
    Join Date
    Aug 2011
    Location
    Lagos, Nigeria
    Posts
    121

    Default Re: a5v10 web: Calculated grid fields for duration -(years,Months, days)

    You are quite right Gaby, but unfortunately I am still a new bee and thus do not yet know the JS function that would return the figure in the required format. So I can say you have answered my question half way.

Similar Threads

  1. a5v10 web: Calculated grid fields for duration -(years,Months, days)
    By fineman77 in forum Alpha Five Version 10 - Desktop Applications
    Replies: 2
    Last Post: 01-20-2012, 09:16 AM
  2. Age in Years, Month, Days
    By John Turner in forum Code Archive
    Replies: 3
    Last Post: 12-04-2008, 03:05 PM
  3. Age in years and months
    By hsl9999 in forum Alpha Five Version 6
    Replies: 4
    Last Post: 10-20-2005, 10:01 PM
  4. Age in months and years
    By Edgar Lewis in forum Alpha Five Version 5
    Replies: 1
    Last Post: 02-01-2004, 09:16 PM
  5. age in months and years
    By Edgar Lewis in forum Alpha Five Version 5
    Replies: 3
    Last Post: 12-04-2002, 02:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •