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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateDiff by month 1

Status
Not open for further replies.

smibarb

Technical User
Jun 24, 2005
40
CA
I am using the DateDiff function to calculate the number of months a report spans. I would expect, for example, that a report that spans from January 1,2004 to December 31, 2004 would return with a count of 12 months, but it is returning 11 months.

Please advise what I may be overlooking.

DateDiff ("m",{?START DATE} ,{?END DATE} )

Thanks in advance.
 
Were you to check 12/31/2004 and 12/31/2005 it would be 12 months.

The difference is 11 months and 30 days.

If you used:

DateDiff ("m",{?START DATE}-1,{?END DATE} )

you'd get 12 months. Date diff provides the number of months, not a rounding.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top