PC Review


Reply
Thread Tools Rate Thread

date diff funtion

 
 
MKoonce
Guest
Posts: n/a
 
      22nd Jun 2009

I am trying to take a birthday and entry date into our program and find out
the month. For example

Jane doe birthday is 11/1/08 and she enrolled 6/1/09. how do i find the age
in months at the time she enrolled?? what would be my formula? I have tried
several but I think I am missing a piece to it.
 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      22nd Jun 2009

=DateDiff("m", [DOB], [EnrollDate]) - IIf(Format([EnrollDate], "dd") <
Format([DOB], "dd"), 1, 0)

DateDiff works by reporting "boundary crossings". If DOB is 31 May, 2009 and
EnrollDate is 1 June, 2009, that will be treated as 1, since you crossed
from one month to another. By comparing the days, you can reduce that count
by one unless a full month has transpired.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"MKoonce" <(E-Mail Removed)> wrote in message
news:75A8182A-0C4B-4CCE-8F25-(E-Mail Removed)...
>I am trying to take a birthday and entry date into our program and find out
> the month. For example
>
> Jane doe birthday is 11/1/08 and she enrolled 6/1/09. how do i find the
> age
> in months at the time she enrolled?? what would be my formula? I have
> tried
> several but I think I am missing a piece to it.



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula to help with Date funtion btyler Microsoft Excel Misc 4 8th May 2009 12:40 PM
How do I find age in years from anniversary date (Age funtion)? Enquire Microsoft Excel Worksheet Functions 1 1st Jan 2008 03:37 PM
Excel date funtion Craig Microsoft Excel Misc 2 10th Jul 2006 05:13 PM
date (minus) date = working days diff jjj Microsoft Excel Misc 3 6th Dec 2005 03:16 PM
DATE() funtion won't work dr ken Microsoft Access 1 18th Jan 2004 09:52 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:16 AM.