Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Noodlescratcher of a ComboBox Qry (sort items by date) 1

Status
Not open for further replies.

newyorkny

IS-IT--Management
Jun 30, 2004
189
HK
Hello, Tippers!

I have a combo-box that drops down available reports. The name of each report is in the following format:

Transfer[MON]A200X

Example:

TransferFebA2004

The problem is that the combo-box list is not in chrono order.

What I would like to do is order by month and year. Say, ok, Access, look first at the 17th character (the last digit of the year) and order by it in descending order, THEN look at the 8,9,10 spots and order according to month.

Now THATSA difficult query! Can anyone help with this, as Ned Flanders might say "dilly of a pickle?"

Thanks in advance for your time and consideration!

NY
 
erm, you might want to try to extract the year and month and put them into fields first, then just order by those 2 fields, and keep them hidden on the actual report...

something along the lines of:

SELECT blah, blah, ..., MID(9, 3) AS Month, Right(4) AS Year FROM ...

--------------------
Procrastinate Now!
 
Something like this ?
TransferFebA2004
ORDER BY CDate("01-" & Mid(ReportName,9,3) & "-" & Right(ReportName,4))

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top