Help me format a date in a query

mraccess101

Registered User.
Local time
Today, 13:35
Joined
Feb 11, 2013
Messages
21
Can somebody help me with the following problem?

On the field "wachttijd" (waiting time in dutch) I want a date format instead a number. The formate should be something like this: 2 years, 3 months and 24 days.

Since I'm a beginner in Access, I don't know how to do it. I hope someone can help me on this.

Image1
Screen_Shot_2013_03_03_at_1_09_05_AM.png


Image2
Screen_Shot_2013_03_03_at_1_09_19_AM.png
 
2 years, 3 months and 24 days

The problem with that output is that both 'years' and 'months' don't have a specific definitions. For example, how long ago was February 1, 2011? 2 years, 1 month and 1 days? 2 years 1 month, 0 days? 2 years, 0 months, 28 days? 2 years, 0 months, 29 days?

Whatever you decide upon I would look at the DateDiff function (http://www.techonthenet.com/access/functions/date/datediff.php) it will return the difference in one unit (days, months, years). You could determine the number of days and then do division to work out all the other time units.
 

Users who are viewing this thread

Back
Top Bottom