Week not sorted correctly

  • Thread starter Thread starter Kevin Labore
  • Start date Start date
K

Kevin Labore

I am sure there is a simple solution to this
I have a query that has "Week: Format([Date],"ww")"
and then it groups by , ascending order.

The problem is that it apparently assumes its a text value rather than
numeric and the results would be (1,10,11 ....2,20,21, etc) I want to get
(1,2,3,4,etc) for a result. I suppose I could sort by date and then let the
report sort/group by week but I would rather do it in the query.

What do I need to do this in the query?

thanks

Kevin
 
Dear Kevin:

Format will always return a string. To return an integer, look at the
DatePart function instead.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
Thanks for the help Datepart is what I wanted I forgot about the difference

Kevin

Tom Ellison said:
Dear Kevin:

Format will always return a string. To return an integer, look at the
DatePart function instead.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts


I am sure there is a simple solution to this
I have a query that has "Week: Format([Date],"ww")"
and then it groups by , ascending order.

The problem is that it apparently assumes its a text value rather than
numeric and the results would be (1,10,11 ....2,20,21, etc) I want to get
(1,2,3,4,etc) for a result. I suppose I could sort by date and then let the
report sort/group by week but I would rather do it in the query.

What do I need to do this in the query?

thanks

Kevin
 
Back
Top