sorting dates

  • Thread starter Thread starter Danny J
  • Start date Start date
D

Danny J

Hello all,

I would like to sort by year. years are double figures, eg 97, 98, 99, all
sort no problem. 00 for 2000 goes (naturally enough) straight to the
beginning of the list. Argh!

Suggestions gratefully appreciated.

Danny
 
Danny said:
Hello all,

I would like to sort by year. years are double figures, eg 97, 98, 99,
all
sort no problem. 00 for 2000 goes (naturally enough) straight to the
beginning of the list. Argh!

Suggestions gratefully appreciated.

Danny


The problem is you are not sorting by year because you don't have years,
you have text or maybe numbers and Access is sorting by text or number.

In any case it maybe the best idea, in the long run to change the filed
to date-time type.

In any case it looks like you are going to need to change the current
data to something different.

You may be able to do it quickly with an update query using something
like:


If it is currently a number field:
iif [field name] <100, ([field name] + 1000)

If it is currently a text field
iif [field name] <100, ("10" & [field name])


That should get you to all four digit years.

Note: leaving this as a number field is likely to cause you additional
unexpected problems in the future. You can display the dates just showing
the four digit year or if you like a two digit year and it will still sort
properly if it is a real date.
 
Would there be a down side for you to convert the years to 4 digit ?
Rosco
 

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

Back
Top