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!

Days per month in a group 1

Status
Not open for further replies.

bartsimpson

IS-IT--Management
Jul 23, 2001
100
GB
I need to do some calculations on data for a number of months, based on the number of days in the month.
For example, if I have 3 events in january, then I would have a figure of 3 / 31 = 0.097. I do this for all of the months in the year, in one report, based on a group by month.

Many people have asked a similar question about the number of days per month, but all are based on a known start date & end date. How do I do this ( using DateDiff, I presume ) when the start and end dates are based on a group, so it's the group that specifies the start date & end date ?
 
Try:

datediff("d",
date(year({table.date}),month({table.date}),01),
dateserial(year({table.date}),month({table.date})+1, 01)-1)

-LB
 
That is beautiful - except you don't need the "-1" at the end.

Many thanks, lbass.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top