Here is the query. can you show me how I would add what you wrote. [Which]
the field that needs sorted
SELECT Table1.[Job Number], Table1.SetterCompany, Table1.[Date To], Table1.
[Date From], Table1.Amount, Table1.[File Number], TodayToAppendTo.Item,
TodayToAppendTo.Size, TodayToAppendTo.Avl, TodayToAppendTo.[Req'd],
TodayToAppendTo.[Curr Routing], TodayToAppendTo.Sts, TodayToAppendTo.Field17,
TodayToAppendTo.Field18, TodayToAppendTo.Field19, TodayToAppendTo.Left,
TodayToAppendTo.Field21, TodayToAppendTo.Field22, TodayToAppendTo.Field23,
TodayToAppendT

rdered, TodayToAppendTo.Field25, TodayToAppendTo.Style,
TodayToAppendTo.Due, TodayToAppendTo.Type, TodayToAppendTo.Which, Table1.Text
FROM (QryTodayImportDueFileNumber LEFT JOIN Table1 ON
QryTodayImportDueFileNumber.[MaxOfFile Number] = Table1.[File Number]) LEFT
JOIN TodayToAppendTo ON QryTodayImportDueFileNumber.Job = TodayToAppendTo.
Job;
Well you could use an ORDER BY clause like this:
ORDER BY [Status], DaysOld DESC
But, it wouldn't have the "sales" Status first - "old sales" would be
first, alphabetically.
You could have an order_by column in your table and just assign a number
to each Status value:
order_by Status
1 sales
2 stock
3 old sales
... etc. ...
Then just use:
ORDER BY order_by, DaysOld DESC
You could also create a order_by column in the SELECT clause and then
sort by that column:
SELECT Switch([Status]="sales",1,
[Status]="stock",2,
[Status]="old sales",3) As order_by,
...... etc. ...
FROM ...
WHERE ...
ORDER BY 1, DaysOld DESC
The ORDER BY 1 means sort by the first column value. This way you don't
have to enter the complete Switch() function in the ORDER BY clause -
you can if you want.
Be sure to add the different Status values and the sort order number to
the Switch() function. For more info on Switch see the VBA help article
Switch Function.
I have a query that returns [DaysOld],[Status]
[quoted text clipped - 7 lines]
I can think of a few ways for assigning of new field New Field:IIF([sales],2,
"A") Even writing that reveals a lot of problems. Thanks