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  

Sorting report by country, first all US, than all other countries



 
 
Thread Tools Display Modes
  #1  
Old December 6th, 2005, 01:29 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Sorting report by country, first all US, than all other countries

I have a report in Access 2003 which lists data by countries. I need the
output in the report to print as follows. In outher words, I need it to list
US countries first, the all other countries in alphabetical order.

Country Serial number
United States 4,444,444
United States 4,444,445
United States 4,444,544
United States 4,445,444
Australia 3,464,444
Australia 3,844,444
Bulgaria 2,424,444
Canada 3,222,111

Instead, it currently prints like this:
Australia 3,464,444
Australia 3,844,444
Bulgaria 2,424,444
Canada 3,222,111
United States 4,444,444
United States 4,444,445
United States 4,444,544
United States 4,445,444

Any assistance would be greatly appreciated.


  #2  
Old December 6th, 2005, 01:54 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Sorting report by country, first all US, than all other countries

Create a field for sorting only, and do not display this field. One way to do
this would be to sort by alphabetical order, but use a switch in your sort
field like:
switch([country_name]="United States","AAAUnited States",true, [country_name])

This will put United States at the top of your list, and all other country
names will keep the same order.


  #3  
Old December 6th, 2005, 02:12 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Sorting report by country, first all US, than all other countries

1. Create a query into this table.
In a fresh column in the FieldRow, enter this expression:
IsUSA: [Country] = ("United States")
Use this query as the RecordSource of your report.

2. In report design view, open the Sorting And Grouping box (View menu.)
In the first row, choose the IsUSA field.
In the second row, choose the Country field.

Explanation: The expression returns True for USA, False for all other
countries (and Null if country is blank.) True sorts before False.

--
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.

"LDMueller" wrote in message
...
I have a report in Access 2003 which lists data by countries. I need the
output in the report to print as follows. In outher words, I need it to
list
US countries first, the all other countries in alphabetical order.

Country Serial number
United States 4,444,444
United States 4,444,445
United States 4,444,544
United States 4,445,444
Australia 3,464,444
Australia 3,844,444
Bulgaria 2,424,444
Canada 3,222,111

Instead, it currently prints like this:
Australia 3,464,444
Australia 3,844,444
Bulgaria 2,424,444
Canada 3,222,111
United States 4,444,444
United States 4,444,445
United States 4,444,544
United States 4,445,444

Any assistance would be greatly appreciated.




  #4  
Old December 6th, 2005, 02:16 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Sorting report by country, first all US, than all other countries

You must include the "=" at the beginning of the function/expression.

--
Duane Hookom
MS Access MVP
--

"slaze" wrote in message
...
Create a field for sorting only, and do not display this field. One way to
do
this would be to sort by alphabetical order, but use a switch in your sort
field like:
switch([country_name]="United States","AAAUnited States",true,
[country_name])

This will put United States at the top of your list, and all other country
names will keep the same order.




  #5  
Old December 6th, 2005, 02:23 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Sorting report by country, first all US, than all other countries

In the reports Sorting and Grouping Dialog, try entering these two lines

Field/Expression : Sort Order
---------------------------------------------
=Country = "United States" : Ascending
Country : Ascending

You may have to switch the Sort Order on the first line to Descending. Try
the proposed setup first.

"LDMueller" wrote in message
...
I have a report in Access 2003 which lists data by countries. I need the
output in the report to print as follows. In outher words, I need it to
list
US countries first, the all other countries in alphabetical order.

Country Serial number
United States 4,444,444
United States 4,444,445
United States 4,444,544
United States 4,445,444
Australia 3,464,444
Australia 3,844,444
Bulgaria 2,424,444
Canada 3,222,111

Instead, it currently prints like this:
Australia 3,464,444
Australia 3,844,444
Bulgaria 2,424,444
Canada 3,222,111
United States 4,444,444
United States 4,444,445
United States 4,444,544
United States 4,445,444

Any assistance would be greatly appreciated.




  #6  
Old December 6th, 2005, 02:27 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Sorting report by country, first all US, than all other countr

Thank you so much for your assistance. I appreciate your help.

"Duane Hookom" wrote:

You must include the "=" at the beginning of the function/expression.

--
Duane Hookom
MS Access MVP
--

"slaze" wrote in message
...
Create a field for sorting only, and do not display this field. One way to
do
this would be to sort by alphabetical order, but use a switch in your sort
field like:
switch([country_name]="United States","AAAUnited States",true,
[country_name])

This will put United States at the top of your list, and all other country
names will keep the same order.





  #7  
Old December 6th, 2005, 02:28 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Sorting report by country, first all US, than all other countr

Thank you so much for your assistance. Now the report works exactly as I
needed.

Thanks again!

"Allen Browne" wrote:

1. Create a query into this table.
In a fresh column in the FieldRow, enter this expression:
IsUSA: [Country] = ("United States")
Use this query as the RecordSource of your report.

2. In report design view, open the Sorting And Grouping box (View menu.)
In the first row, choose the IsUSA field.
In the second row, choose the Country field.

Explanation: The expression returns True for USA, False for all other
countries (and Null if country is blank.) True sorts before False.

--
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.

"LDMueller" wrote in message
...
I have a report in Access 2003 which lists data by countries. I need the
output in the report to print as follows. In outher words, I need it to
list
US countries first, the all other countries in alphabetical order.

Country Serial number
United States 4,444,444
United States 4,444,445
United States 4,444,544
United States 4,445,444
Australia 3,464,444
Australia 3,844,444
Bulgaria 2,424,444
Canada 3,222,111

Instead, it currently prints like this:
Australia 3,464,444
Australia 3,844,444
Bulgaria 2,424,444
Canada 3,222,111
United States 4,444,444
United States 4,444,445
United States 4,444,544
United States 4,445,444

Any assistance would be greatly appreciated.





  #8  
Old December 6th, 2005, 03:05 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Sorting report by country, first all US, than all other countries

LDMueller wrote:

I have a report in Access 2003 which lists data by countries. I need the
output in the report to print as follows. In outher words, I need it to list
US countries first, the all other countries in alphabetical order.

Country Serial number
United States 4,444,444
United States 4,444,445
United States 4,444,544
United States 4,445,444
Australia 3,464,444
Australia 3,844,444
Bulgaria 2,424,444
Canada 3,222,111

Instead, it currently prints like this:
Australia 3,464,444
Australia 3,844,444
Bulgaria 2,424,444
Canada 3,222,111
United States 4,444,444
United States 4,444,445
United States 4,444,544
United States 4,445,444




In the report's Sorting and Grouping window (view menu) set
it to first sort on the expression:
Country "United States"
and set the second sort to the field Country

--
Marsh
MVP [MS Access]
 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
subreport not displaying in main report JohnLute Setting Up & Running Reports 15 November 17th, 2005 04:02 PM
Printing Reports Access 2002 Pleas Advise Dermot Database Design 12 October 5th, 2005 11:23 AM
No current record 3021 hughess7 General Discussion 30 August 19th, 2005 04:39 PM
To Sharkbyte and all: Calculate a total values in group level Ally General Discussion 6 June 13th, 2005 08:16 PM
Save Report With CreateReport Coding Issue Jeff Conrad Setting Up & Running Reports 8 July 12th, 2004 08:39 AM


All times are GMT +1. The time now is 06:27 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.