[AccessD] custom sorts/groups in a report

Susan Harkins ssharkins at bellsouth.net
Sat Apr 17 19:15:58 CDT 2004


I've got it grouping correctly now -- the problem was passing the first day
of the week variable to the report. I decided to use a function to pass it
to the query instead of the report.

When you say "grouping level" what do you mean? I tried a calculation with
GroupLevel and couldn't get it to work, but just might not have had the
syntax right in the statement. I need something flexible enough to allow me
to pass a new firstdayoftheweek value. Come to think of it, I didn't try
GroupOn -- and maybe that was what I needed. I will have to go back and try
that one again.  

Now, I just need to figure out how to get the first day of that week to
print in the group's header -- and it needs to be dynamic enough to handle
any day of the week as the first day of the week. 

If the date's Thursday, July 25, 1996 which falls in the 31st week of the
year where Wed is the first day of the week... how do I return Wednesday,
July 25, 1996? That's my problem. :) the expression has to adapt to any
firstdayoftheweek value, not just Wed.     

Susan H. 

On 17 Apr 2004 at 18:46, Susan Harkins wrote:

> I'm grouping and sorting a report on a date field. The grouping is by 
> the week -- but I want it to handle a changing first day of the week 
> variable. I can't get my head around it at all.
>  
> Passing the first day of the week around is no problem -- I just can't 
> seem to get Access to group by it. I've looked at CreateGroupLevel, 
> but I don't see how that can help.
>  
> I tried adding a DatePart expression to the Detail section and using 
> the OpenArgs property to pass the first day of the week, and while the 
> expression works, I can't group by it -- it's a calculated control. I 
> don't want the users manipulating the underlying query either. They 
> choose the first day of the week from a simple form and the rest needs 
> to happen behind the scenes.
>  

You can group by a calculation.
Just put =Datepart("ww",mydate,myfirstday) in a grouping level.

 
--
Lexacorp Ltd
http://www.lexacorp.com.pg
Information Technology Consultancy, Software Development,System Support.



--
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list