Chronologically sort two columns in query

DMerchen

Registered User.
Local time
Today, 03:13
Joined
Sep 9, 2008
Messages
94
I am not sure this is possible without some programming in the background but thought I would throw it out there anyway. I have a database we are using to track committed shipment dates and revised shipment dates. If we slip on a shipment it gets a new revised date and we let the customer know. Is there a way to sort these two columns in chronologically. I will try to provide an example to better illustrate.

Committed Ship Revised Ship
05/24/2011 07/22/2011
06/12/2011 08/05/2011
07/20/2011
07/30/2011

Sort to be this:

Committed Ship Revised Ship
07/20/2011
05/24/2011 07/22/2011
07/30/2011
06/12/2011 08/05/2011

I hope this makes sense. Like I said, just throwing that out there. Thanks for stopping to look.
 
It seems you want to take the latest of the 2 date fields and then sort your data in ascending order. Create a new field in your query like this:

SortOrder: IIf([Revised]>[Committed Ship], [Revised Ship], [Committed Ship])

Then, sort ascending on that field and you could even uncheck the box so that it doesn't show in your data. This will fail if [Committed Ship] is null.
 
Thanks for the help, I found something like this, but it was not working. I do have nulls in both columns. Perhaps there is a way to make them not be null? Will give this a try for sure. Thanks again.
 

Users who are viewing this thread

Back
Top Bottom