Re: Help Needed With Format Of Query Expression



Add two expressions to the query. One is the year and the other is the week
(in that order).
Sort on those and just display your "Week: Format([TxtDate],"ww yy",4)".

Regards

Kevin C

"Wayne" <cqdigital@xxxxxxxxxxxxxxx> wrote in message
news:261662b8-d874-4f05-8304-2c52654ee97a@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I'm using the following expression in the query grid to show the Month
and Year of the date field "TxtDate":

Week: Format([TxtDate],"ww yy",4)

I am grouping the results on this field.

Is there a different way that it can be formatted so that when I sort
the field it will sort by Week and Year e.g.

01 07
02 07
03 07

At the moment it is sorting as a text field:

01 07
10 07
11 07

I can't simply sort by the "TxtDate" field because it isn't part of an
aggregate function and if I Group on TxtDate or use Min or Max the
query gives undesired results.


.



Relevant Pages

  • Re: Show Last 20 rows
    ... Open a new query in design view ... Kevin wrote: ... below is the table i using to colect measurement data. ... Another way to think about that is there must be a field or fields that you can sort by that will put the records in an order so that the last 20 rows can be picked. ...
    (microsoft.public.access.gettingstarted)
  • Re: Make Table Query - Sorting Errors
    ... Dim OutputTable As DAO.Recordset ... The query to concatenate the CAMPNO values will need to be LOOKING at the ... If you post the query you are using to do this, I beleive we can get it to ... Is there a command that I can use in the module code to first sort the ...
    (microsoft.public.access.queries)
  • Re: Make Table Query - Sorting Errors
    ... You sort in a query, ... You can do a compound sort in a query. ... "Tom Ellison" wrote: ... resulting table only has one record for each value of "CAMPNO". ...
    (microsoft.public.access.queries)
  • Re: Query doesnt always sort
    ... You have to use a query to sort the data in to your required order and then ... Access MVP 2002-2005, 2007 ... University of Maryland Baltimore County ... How do I impose a sort on the datasheet view? ...
    (microsoft.public.access.queries)
  • Re: Make Table Query - Sorting Errors
    ... sorted, it will sort them as they arrive. ... you query them, why is this of any concern to you? ... correctly on the field CAMPNO. ... "Duane Hookom" wrote: ...
    (microsoft.public.access.queries)