1

I am using the below expression to get the difference of date between current date and myDateFieldColumn. This gives me no of days. But I want it to display "year-Mon-Days"

=DateDiff("d",MyDateField.Value,Today()).

Any Advice.

Thank you

Hari Gillala
  • 11,736
  • 18
  • 70
  • 117
  • You want like 1-2-6 (1 year, 2 months and 3 days) ? – aF. Dec 13 '11 at 17:29
  • This question is similar http://stackoverflow.com/questions/57599/how-to-calculate-age-in-t-sql-with-years-months-and-days This is where Interval data types would make this easier. – Glenn Dec 13 '11 at 18:57
  • I just wrote a piece of VB to do this but it assumed 31 day months, so would give a 3 day difference between Feb 28th and March 1. I can post that if you'd like but a more robust answer is to use embedded code such as http://boseca.blogspot.com/2008/10/calculate-date-difference-in-years.html – Jamie F Dec 13 '11 at 19:32

0 Answers0