Charlotte Foust
cfoust at infostatsystems.com
Mon Apr 19 14:43:53 CDT 2004
You can only group and sort on a field or an expression involving a field, and no, you can't use variables. Had you mentioned the variable before? Why not just create a "week" field in the query and group and sort on that calculated field. Then you could use your variable to create a filter for the particular week in question. Charlotte Foust -----Original Message----- From: Susan Harkins [mailto:ssharkins at bellsouth.net] Sent: Monday, April 19, 2004 11:21 AM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] custom sorts/groups in a report But I've tried and it won't take it. The OpenArgs argument passes the value I use in all of the date functions. If I refer to is as a variable =DatePart("ww",field,int) I get a parameter prompt asking for int. I even tried setting a text control to the openargs value and referring to that =Date("ww", field, txt) Either way, the sorting and grouping dialog doesn't like it and shows a parameter prompt asking for txt. Everything I've read says the sorting/grouping needs to refer to a field. I was trying to avoid having to pass the firstdayoftheweek to the query itself, but I guess that's an option. I guess I could pass the value to the underlying query and run the week number calculation in the query, instead of in the report. Susan H. Susan, You sort/group on a calculated expression by entering that expression in the grouping and sorting dialog Charlotte Foust -----Original Message----- From: Susan Harkins [mailto:ssharkins at bellsouth.net] Sent: Monday, April 19, 2004 9:28 AM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] custom sorts/groups in a report Well, checked again -- unless I'm just missing something, I don't know how to group/sort by a calculated control within the report itself. Susan H. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Monday, April 19, 2004 1:17 PM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] custom sorts/groups in a report Gustav, I've not been able to sort by a calculated control -- wait... I think I've been doing it wrong -- duh... <hangs head> I'm SUCH a user... ;) If I'm right, I'll let ya know. :) Susan H. Hi Susan Then, in the report, can't you sort and group by =Weekday(YourDate, [YourSelectedFirstWeekday]) /gustav > That's what I'd rather do, simply because it leaves fewer holes. > Susan H. > Hi Susan > Your method looks longwinded but not weird. If it works fast and well > I would leave it, though I'm sure another method could be found where > you adjust the grouping in the report directly. -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com