Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to subtract date or time in Access

Status
Not open for further replies.

aquinox

Programmer
Jul 2, 2007
38
AU
Hi,

Wonder if i could get some help here. We have a company management database created using Access 03. I was asked to put on a form that would calculate an annual leave for all staffs. I know the formula how to work out the annual leave. However, what i'm stuck here is we really want to do it on a basis of pro-rata and don't know how to proceed with it.

For example, staff A started on 7 March 2003 and today is 30 August 2007. don't know how to write the VB code to find out how many hours of work from 7 March 2003 to 31 December 2003 and so on. I can easily work out the annual leave in a year but when it comes to the real time plus pro-rata, i don't know how to do it.

grateful if anyone who might have done this before using Access 03, would like to share it with me the ideas.

Thank you in advance
 
Look up the DateDiff function in VBA help. This will return (if used properly) the number of days in a year.
You can then use this to calculate the amount of leave they should get based on the full year.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top