Re: Query sorting help

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



PERHAPS

Order By NZ(Press1,Nz(Press2,Press3)), DateField

In the query grid, add a calculated field
Field: SetOrder: NZ(Press1,Nz(Press2,NZ(Press3,"ZZZZZ")))
Sort:: Ascending

Then follow that by sorting on the Date field
--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"Darren" <Darren@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:9B5144E5-3928-43D7-8942-A2B5A5D13799@xxxxxxxxxxxxxxxx
This is a single flat database with all data posted in colums like excell.
I
now it is very basic but it works for this user. What I have currently is
a
query that simply filters by due date in ascending order for all active
data.
Each of the Press1-3 data is in its own column of the database. The
desired
result is to sort by press column first then sort found data by date. I
just
don't get how to order the search but a spacific column first and also
show
duplicate items. By duplicate items I mean if a job has pieces on all
three
presses I want to show it in all three sorts. Example I want to sort by
press1 first. Many items from press1 have pieces on Press2 and press3.
Then
at the end of the Press1 sort and display press2 items with any and all
pieces for Press1 and press3.

I have screen captures of the sections of the query results and a screen
capture of the query in design view however I cant seem to be able to
attatch
them to this post. Thanks Carl for your assistance.

--
Darrenc


"KARL DEWEY" wrote:

Try this --
SELECT YourTable.Press1, YourTable.Press2, YourTable.Press3,
YourTable.DueDate
FROM YourTable
ORDER BY YourTable.Press1, YourTable.Press2, YourTable.Press3,
YourTable.DueDate;

If this is not what you need then put your example output data in an
Excel
and then paste in a post.
--
KARL DEWEY
Build a little - Test a little


"Darren" wrote:

I am in need of assistance with a Query. I have a query that assembles
a
daily production schedule. The shedule consists of many fields however
for
the sake of this question i wish to sort the query by a series of four
fields. the first fiedld in the query is "DueDate" then by field
"press1"
then by "Press2" then Press3". The data in the field Due date is the
actual
date due. The data in "press1" will only be "6c" or nothing. The data
in
"Press2" will be one of three Strings: "25", "29", or "25/29". The
data in
"Press3" will only be a string of "17" or nothing. NOTE:It is possible
that
one column to have data in all three press fields or any combination of
press
fields.

KO, Now the desired result;

I wish to display the data first by Field "Press1" if data exists
display it
first and display it in assending order by field "DueDate". Then
display
field "Press2" if data exists display it emdiatly after the data from
field
"Press1" in order by field "DueDate" displaying duplicate data. Then
display
field "Press3" if data exists display it emdiatly after the data from
field
"Press2" in order by field "DueDate" displaying duplicate data.

Please Help!!!!!!!!!!!!

DarrenC
--
ITKid


.



Relevant Pages

  • RE: Query sorting help
    ... result is to sort by press column first then sort found data by date. ... pieces for Press1 and press3. ... I wish to display the data first by Field "Press1" if data exists display it ...
    (microsoft.public.access.queries)
  • Re: Table design question re duplicates fields
    ... I could not get the query to work. ... If I did it this way, will I be able to sort, filter, and find the phone ... Business Fax 800-833-1213 ... Using the subform it will only display if there is data and if no data it ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Access Continuous Form - order of records any bright ideas?
    ... to the sort field and then coded the fields after update event with: ... that the user updates eg 1,2,3,4,5 and then re display the screen. ... Make a query the record source for this form. ... The records will be re-arranged each time the SortOrder field is ...
    (microsoft.public.access.forms)
  • Re: Access Sorting problem - please help! (also in alt.comp.databases)
    ... >How can I make my form display the records in the sorted way I want? ... You have to create a select query with a sort order (an "order by" ... in the order that they appear in the query designer. ...
    (comp.databases)
  • Re: Graph changing date order
    ... Here's the underlying query from which the chart is formed: ... display monthly values for one full year, ... Sort the query on this column. ...
    (microsoft.public.access.reports)