Week not sorted correctly

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
 
T

Tom Ellison

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
 
K

Kevin Labore

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top