Calling all guru's: i am trying to work out the number of days from a given date, but i am new to ms access.
Calling all guru's: i am trying to work out the number of days from a given date, but i am new to ms access.
Check out the DateDiff() function, or perhaps DateAdd() depending on what you're trying to do.
NAME RANK MoB FDOS DAYS OF SICK Paul LCpl June 12/10/11 Paul Cpl July 15/01/12 Stephen LCpl September 24/09/11 David LCpl December 14/09/11 Arthur Sgt April 10/10/10 Andrew Pte December 12/12/11 Paul Brig April 11/11/11 Stephen Col December 06/06/12 SMITH BRIG APRIL 17/04/12
There doesn't appear to be a question, here, only an example of your data!
Check out DateDiff(), along with Date() which returns today's date.
if you look at the table above, i am looking at working out how many days sick an individual has, worked out from the first day of sick, apols to missinglinq
Trying to calculate and save the sick leave days will cause issues. Should be a field for LDOS. Then calculate the difference whenever needed, not save the calculated value.
Use DateDiff function.
DateDiff("d", FDOS, LDOS)
However, if you want the first day included in the count, then +1
DateDiff("d", FDOS, LDOS) + 1
How do you want to deal with weekends and holidays within the date range?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.