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

Calculating Months

Status
Not open for further replies.

bigblue

Programmer
Joined
Sep 10, 2001
Messages
1
Location
US
I have two dates. The start date is 7/13/02 and the end date is 2/1/03. Is there a formula for Crystal 7.0 that can calculate the number of months including partial months between these two dates. I know the answer is 6.612 months. But I cannot figure out the formula in Crystal.

Thanks.
 
I can't recall if CR 7 supports datediff, but that's the function in 8.X.

Try:

if not(onfirstrecord) then
datediff("m", Previous({MyTable.MyField}), {MyTable.MyField})

This would compare the previous date field to the current starting at the second row.

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top