Date range in months from month and year fields

G

Guest

In our database we track consultants work dates in four seperate fields,
starting month, starting year, ending month, ending year.
Is there anyway to calculate the range of months they have worked with this
set up?

So if someone started March 2004 and ended July 2007 is there a formula to
calculate the 40 months they worked?
 
G

Guest

DateDiff("m",[starting month] & "/" & "01" & "/" & [starting year],[ending
month] & "/" & "01" & "/" & [ending year])
 
G

Guest

Replace the "01" with a day field if you have it.. or you can merge it to
"/01/"

Lance said:
DateDiff("m",[starting month] & "/" & "01" & "/" & [starting year],[ending
month] & "/" & "01" & "/" & [ending year])

monkeycr84 said:
In our database we track consultants work dates in four seperate fields,
starting month, starting year, ending month, ending year.
Is there anyway to calculate the range of months they have worked with this
set up?

So if someone started March 2004 and ended July 2007 is there a formula to
calculate the 40 months they worked?
 
D

Douglas J. Steele

If you're actually storing the text for the month (as opposed to a month
number), try:

DateDiff("m", CDate("1 " & StartMonth & " " & StartYear), CDate("1 " &
EndMonth & " " & EndYear))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top