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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to ignore the yy "year" in date sorting?

Status
Not open for further replies.

stanislav

Programmer
Jul 17, 2000
4
UA
How to ignore the year in date sorting?

Normally in VBA (Access) when sorting by date/time data you get the data
sorted 1)yy 2)mm 3)dd like:

dd.03.97
dd.07.98
dd.09.98
dd.04.99
...

Please give me a hint how to get it as follows:

dd.03.97
dd.04.99
dd.07.98
dd.09.98
...

(i.e. ignoring the yy - "year")
purpose: sorting the dates like holydays or birthdays etc.


The sorting is invoked in a form from form module by
[Me.orderby = ...] and [SELECT ... ORDER BY ...] instructions.


Thank you for a detailed answer. I`m a very beginner in Access VBA.
Trying to making my database using MSOffice standard help files. :eek:)

Stanislav /Touch/
 
Hi!

Try this:

Order By Format(YourDateField, "mmdd")

hth
Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top