Sorting records by week number

  • Thread starter Thread starter Ashley
  • Start date Start date
A

Ashley

I have my records sum and group by date in week number.
But I can't get the week number in the right order.
It currently output as 14,15,16,17,18,19,20,3,4,5,6.
I would like it to be 3,4,5,6,14,15,16,17,18,19,20.
Any help is appreciated.
 
I have my records sum and group by date in week number.
But I can't get the week number in the right order.
It currently output as 14,15,16,17,18,19,20,3,4,5,6.
I would like it to be 3,4,5,6,14,15,16,17,18,19,20.
Any help is appreciated.

How are you computing the week number?
Is it not sorting properly in a report or just not sorting in the
query?

The week number can be obtained by using the DatePart function
WeekNo:DatePart("ww",[DateField])
Sort on this [WeekNo] field

If it sorts properly in the query, but not in a report, you must set
the report's sort order in the report's Sorting and Grouping dialog.
The sort of the query is irrelevant.
 
Thanks Fred,
I got the week sorted by number in the report. But I have
weeks in 2003. It not sorting by Year Week. Please help!
-----Original Message-----
I have my records sum and group by date in week number.
But I can't get the week number in the right order.
It currently output as 14,15,16,17,18,19,20,3,4,5,6.
I would like it to be 3,4,5,6,14,15,16,17,18,19,20.
Any help is appreciated.

How are you computing the week number?
Is it not sorting properly in a report or just not sorting in the
query?

The week number can be obtained by using the DatePart function
WeekNo:DatePart("ww",[DateField])
Sort on this [WeekNo] field

If it sorts properly in the query, but not in a report, you must set
the report's sort order in the report's Sorting and Grouping dialog.
The sort of the query is irrelevant.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.
 
Set your sorting and grouping expression to:
=Format([DateField], "yyyyww")

--
Duane Hookom
MS Access MVP


Thanks Fred,
I got the week sorted by number in the report. But I have
weeks in 2003. It not sorting by Year Week. Please help!
-----Original Message-----
I have my records sum and group by date in week number.
But I can't get the week number in the right order.
It currently output as 14,15,16,17,18,19,20,3,4,5,6.
I would like it to be 3,4,5,6,14,15,16,17,18,19,20.
Any help is appreciated.

How are you computing the week number?
Is it not sorting properly in a report or just not sorting in the
query?

The week number can be obtained by using the DatePart function
WeekNo:DatePart("ww",[DateField])
Sort on this [WeekNo] field

If it sorts properly in the query, but not in a report, you must set
the report's sort order in the report's Sorting and Grouping dialog.
The sort of the query is irrelevant.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.
 
Back
Top