Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 11th, 2005, 08:06 AM
Authorized User
 
Join Date: Dec 2003
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Default date type queries

hi all members i want urgent help
In my table doa(date of appointment ) and dor(date of retirement ) field now I want qualifying service from dor-dor like day, month, year eg:
Dor=31/03/2004
Doa=02/01/1973

qualifying service= day month year
Jan-1973 30 0 0
Feb-1973 to 31st Dec-1973 0 11 0
1st Jan-1974 31st Dec-2003 0 0 29
1st Jan-2004 31st Mar-2004 0 3 0
                -------------------------
        Total 30 14 29
Month is >12 year should 30 like
                Day month year
                                30 2 30
in above eg. How should write the date function


Mohamed Mohiddin
Officer
__________________
Mohamed Mohiddin
Officer
 
Old January 11th, 2005, 01:41 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

If I understand the problem correctly, you will be getting a total for days, months and years.

I would look at days, and if the number is greater than 30, divide the number by 30 and truncate the result to give the number of months, and the take the number of days % 30 to get the remaining days. You can then do the same thing with the months i.e. if greater than 12, divide by 12 truncate the fractional part of the answer, and add to years, and then use the mod function to determine the number of months remaining, or alternatively, subtract the number of new years added * 12 from the original number of months.

Mike
EchoVue.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Type checking NEO1976 XSLT 5 February 1st, 2007 10:37 AM
date type queries mohiddin52 Access 5 July 29th, 2005 03:32 PM
date and price queries beanfair Access 1 April 20th, 2005 03:34 AM
date type queries mohiddin52 Access 1 March 19th, 2004 03:05 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.