Re: Query sorting help
- From: "John Spencer" <spencer@xxxxxxxxx>
- Date: Mon, 28 Jan 2008 11:48:18 -0500
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
.
- References:
- RE: Query sorting help
- From: Darren
- RE: Query sorting help
- Prev by Date: Re: Multiple records for one parameter
- Next by Date: Re: Multiple records for one parameter
- Previous by thread: RE: Query sorting help
- Next by thread: Multiple records for one parameter
- Index(es):
Relevant Pages
|