SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jan 2009
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Calculate age and produce output like "Yr.Mth"

    Hi,

    I found similar solution to my problem, from this post:

    http://www.sitepoint.com/forums/showthread.php?t=562909

    But can the same formula produce output like this:
    7.8 OR
    7 Years 8 Months

    TIA Rudy!

  2. #2
    SitePoint Member
    Join Date
    Jan 2009
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no response, maybe my question is to difficult or to silly to answers, oh well no problem...

    I found solution to the problem, as following:

    DATE_FORMAT(FROM_DAYS(TO_DAYS(NOW())-TO_DAYS(Employee.dDOEmp)), '%y.%m')

    the result look like so:

    01.05 (or 1 year 5 months)

    But the problem is, when the result is below 1 year, it showed as following:

    00.00

    Can anyone help me to solve this one?

    TIA


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
  •