Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hello..
i have a problem with grouping days
if i want to group days by 7days pergroup, i'll easyly use week(date)
but how to make group that contain 3days pergroup ?
thx...
hello..
i use =date(floor(mst_date/3)*3)
and it shows the first date of group
how to change it, so it shows the last date of group?
thx..
Hi,
sorry, I was off for a while...
I haven't tried, but it might be ceil instead of floor!
Regards
Martin
martin.goettler wrote:I haven't tried, but it might be ceil instead of floor!
Exactly. You'll get a one day offset compared to the groups that floor() assigns, but since there was no particular meaning to the starting date for the floor() groups, the ceil() groups are as good as any. If for some reason you wanted the same groups, just add 1 to the date, date(ceil((mst_date+1)/3)*3), but I don't see a point to that.
As far as grouping AVAILABLE days into groups of three, it's not possible to do that mathematically. You'd have to do something more complicated, such as sorting your data by Date, and then incrementing a counter every time the date changes by checking previous(Date), and then applying the function to the counter instead of to the date itself. Or if you have a calendar table with missing days, just apply the function to recno().
@Martin
thx Mrtin..
@John
do u have any sample for that John?
and what is recno() function for?
thx..