A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Ordering



 
 
Thread Tools Display Modes
  #1  
Old July 12th, 2007, 09:44 AM posted to microsoft.public.access.reports
Fie
external usenet poster
 
Posts: 32
Default Ordering

Hi,

I have a report which is based on a table called tblStreetSweeping and
has the fields (Date, TicketNo, Type & Weight). Each finacial year
runs from April to March, the data in the table ranges from April 2006
to July 2007, in my query I have the formula SortMthNum:
Month(DateAdd("m",-3,[Date])) but it just takes in to account the
month and not the year, How do i get the data to be sorted in the way
it displays it April 2006, May 2006, June 2006, july 2006 all the way
thru to july 2007 .
In each month I would like the data broken to the actual pick up day
i.e Monday, Tuesday, Wednesday etc. In my query I have the formula
Day: Format([Date],"dddd") but when I run the report it sorta it
alphabetically, how do you get it to order it Monday, Tuesday,
Wednesday etc?

Confused!!
Fie

  #2  
Old July 12th, 2007, 10:16 AM posted to microsoft.public.access.reports
Allen Browne
external usenet poster
 
Posts: 11,706
Default Ordering

Add another calcualted field:
SortYear: Year(DateAdd("m", -3, [Date]))

And another one to solve the day of the week issue:
TheDay: WeekDay([Date])
This will return 1 to 7 (for Sun to Sat), which sorts correctly.

BTW, if your field really is called Date, that could cause problems. This
query should work correctly because you added the square brackets, but
Access is likely to have problems interpreting such a name.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Fie" wrote in message
oups.com...

I have a report which is based on a table called tblStreetSweeping and
has the fields (Date, TicketNo, Type & Weight). Each finacial year
runs from April to March, the data in the table ranges from April 2006
to July 2007, in my query I have the formula SortMthNum:
Month(DateAdd("m",-3,[Date])) but it just takes in to account the
month and not the year, How do i get the data to be sorted in the way
it displays it April 2006, May 2006, June 2006, july 2006 all the way
thru to july 2007 .
In each month I would like the data broken to the actual pick up day
i.e Monday, Tuesday, Wednesday etc. In my query I have the formula
Day: Format([Date],"dddd") but when I run the report it sorta it
alphabetically, how do you get it to order it Monday, Tuesday,
Wednesday etc?

Confused!!
Fie


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:13 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.