PC Review


Reply
Thread Tools Rate Thread

How do I sort a table by 2 different field types?

 
 
Sierre Demonte Aires
Guest
Posts: n/a
 
      9th Nov 2008
I am trying to sort an Access 2007 table that I created, first by the Primary
Key Field and then by the Date Field. and I really do not feel like creating
a query, so how can I go about doing that?
--
SDA
 
Reply With Quote
 
 
 
 
Rick Brandt
Guest
Posts: n/a
 
      9th Nov 2008
Sierre Demonte Aires wrote:
> I am trying to sort an Access 2007 table that I created, first by the
> Primary Key Field and then by the Date Field. and I really do not
> feel like creating a query, so how can I go about doing that?


Tables cannot be sorted. Period.

When you view a table's datasheet Access is producing something visual for
you to see the data. The data viewed in that "thing" can be sorted and it
can be fiddled with as far as moving columns around, changing column widths,
etc., but none of that affects the actual table under the covers. None of
it affects how the table's data is reflected in forms, reports, queries, or
code.

SELECT *
FROM TableName
ORDER BY ThisField, ThatField


The query above would take all of 10 seconds to produce. What is your
objection to doing so?

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      9th Nov 2008
On Sun, 9 Nov 2008 06:25:00 -0800, Sierre Demonte Aires
<(E-Mail Removed)> wrote:

>I am trying to sort an Access 2007 table that I created, first by the Primary
>Key Field and then by the Date Field. and I really do not feel like creating
>a query, so how can I go about doing that?


You don't.

Tables are for storing data.

Queries are for selecting, combining and sorting data.

Forms are for displaying data onscreen.

Reports are for printing.


Use the correct tool for the job you're trying to do.
--

John W. Vinson [MVP]
 
Reply With Quote
 
John Spencer
Guest
Posts: n/a
 
      10th Nov 2008
One other thing.

If you have sorted by the primary key, then there is no other sort to do.
Primary key is unique and therefore sorting by the primary key is going to
produce a unique order so any subsequent fields involved in the sort will have
NO impact.

If you want to sort by the date field and then by the primary key field then
you will have a different sort.

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County

John W. Vinson wrote:
> On Sun, 9 Nov 2008 06:25:00 -0800, Sierre Demonte Aires
> <(E-Mail Removed)> wrote:
>
>> I am trying to sort an Access 2007 table that I created, first by the Primary
>> Key Field and then by the Date Field. and I really do not feel like creating
>> a query, so how can I go about doing that?

>
> You don't.
>
> Tables are for storing data.
>
> Queries are for selecting, combining and sorting data.
>
> Forms are for displaying data onscreen.
>
> Reports are for printing.
>
>
> Use the correct tool for the job you're trying to do.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linked Table Field Types =?Utf-8?B?U3RldmVuIE0uIEJyaXR0b24=?= Microsoft Access External Data 0 22nd Sep 2006 04:30 PM
Pivot table field types stevehere Microsoft Excel Misc 2 1st Jun 2005 11:54 AM
Need query to separate 2 entry types in a table field Jan Il Microsoft Access Queries 31 23rd Nov 2004 05:57 PM
How can I print all the field names & data types from a table M.Siler Microsoft Access 14 28th Oct 2004 08:05 PM
make table field types Mary Flowers Microsoft Access Queries 1 2nd Oct 2003 12:50 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:47 PM.