Re: sort in report
- From: lake2212 <lake2212@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 15 Jul 2008 09:54:05 -0700
Great, I got the first 2 things done. On #3 below - I only want the user to
enter a month and year, so how would I go about that but still be able to
sort on the date? Thanks.
Julie
"fredg" wrote:
On Tue, 15 Jul 2008 04:55:00 -0700, lake2212 wrote:.
I am setting up a new database. I will have a table with the following
fields I would like to sort on in a report:
Security Name – text field
Security Type – text (can be equal to ‘S’, ‘P’, or ‘C’)
Option Description – this field contains 3 types of information – a month, a
year, a price (examples: Jan-08-25, Feb-07-3.50) (I'd like not to print
decimals unless they are entered by the user)
Is there a way to sort on all these fields in a report?
First – by security
Second – by type (but I want the records to print in this order 'S', 'C', 'P')
Third, forth and fifth – by option month, year and price
I'm still in the design process so changes can be made. Thanks.
1) Add a new column to your query.
SortThis:IIf([SecurityType] = "S",1,IIf([SecurityType] = "C",2,3)
2) Tho proper place to sort your report is in the report's Sorting and
Grouping dialog (not in the query).
In Report Design View, click on View + Sorting and Grouping
In the Field/Expression column and Sort columns, enter:
[SecurityName] Ascending
[SortThis] Ascending
The above will sort the report by SecurityName then SecurityType in
"S", "C", "P" order.
3) As far as then sorting according to the value in your
OptionDescription field, NO you won't be able to.
OptionDescription is a Text (or Memo) datatype field.
You will not be able to sort Jan before Apr because they are not seen
by Access as dates, so Apr would sort before Jan. Also, in a text
field, 12.50 would sort before 4.50.
Your database is not normalized. You should have 2 more fields. One
field as Date datatype, and another as Number datatype. You enter the
date in one field (a valid date, containing month, day, and year) and
the other field enter the price.
Then it would be a simple matter to just add those two fields to the
report's Sorting and Grouping dialog so that they are included in the
sorting.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
- Follow-Ups:
- Re: sort in report
- From: fredg
- Re: sort in report
- References:
- Re: sort in report
- From: fredg
- Re: sort in report
- Prev by Date: How do I copy a table to a new table?
- Next by Date: search box needed
- Previous by thread: Re: sort in report
- Next by thread: Re: sort in report
- Index(es):
Relevant Pages
|