Complex Sorting

C

cna48

I have a report of our manufacturing schedule. I have two columns I need to
sort by. There is a [Prod Date] column and a [Ship Date]. I need the
schedule to be sorted so that any rows that have a [Ship Date] < Now()+21 are
sorted by [Ship Date] and any that have a [Ship Date]> Now()+21 are then
sorted by [Prod Date].
 
S

Stefan Hoffmann

hi,
I have a report of our manufacturing schedule. I have two columns I need to
sort by. There is a [Prod Date] column and a [Ship Date]. I need the
schedule to be sorted so that any rows that have a [Ship Date] < Now()+21 are
sorted by [Ship Date] and any that have a [Ship Date]> Now()+21 are then
sorted by [Prod Date].
You need a calculated sorting column:

SortingColumn:
Iif([Ship Date] < Now() + 21, [Ship Date], [Prod Date])

And sort by that column.

Caveat:
Your description has a hole, what do you like do to when

[Ship Date] = Now() + 21

?

btw, you should consider using field names without special characters.


mfG
--> stefan <--
 
M

Marshall Barton

cna48 said:
I have a report of our manufacturing schedule. I have two columns I need to
sort by. There is a [Prod Date] column and a [Ship Date]. I need the
schedule to be sorted so that any rows that have a [Ship Date] < Now()+21 are
sorted by [Ship Date] and any that have a [Ship Date]> Now()+21 are then
sorted by [Prod Date].


Set the report's Sorting and Grouping Field/Expression to an
expression like:
=IIf([Ship Date] < Date()+21, [Ship Date], [Prod Date])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top