date order

  • Thread starter Thread starter Evelyn Ballantyne
  • Start date Start date
E

Evelyn Ballantyne

I have dates in this format - dd/mm/yyyy and I need to
sort the records in date order but just dd/mm and NOT by
the year,Can anyone help please??
Thank you for this site, dont know what i would do
without it.
Evelyn
 
Create a calculated field in your query:
SortDates: Format([DateFieldName], "dd/mm")

And do the sort on the calculated field. Note that this will sort this way:
01/01
01/02
01/03
02/01
03/03
etc.

If that is not what you want but instead want
01/01
02/01
01/02
01/03
03/03
then you will need two calculated fields:
SortDateM: Format([DateFieldName], "mm")
SortDateD: Format([DateFieldName], "dd")

Be sure that SortDateM is to the left of the SortDateD field. Sort on these
fields.
 
Thank you so much Ken, I used the second option - just
one more thing - every entry does not have a date - How
can I stop the entries with no date entered from printing
in the report please?
Evelyn
-----Original Message-----
Create a calculated field in your query:
SortDates: Format([DateFieldName], "dd/mm")

And do the sort on the calculated field. Note that this will sort this way:
01/01
01/02
01/03
02/01
03/03
etc.

If that is not what you want but instead want
01/01
02/01
01/02
01/03
03/03
then you will need two calculated fields:
SortDateM: Format([DateFieldName], "mm")
SortDateD: Format([DateFieldName], "dd")

Be sure that SortDateM is to the left of the SortDateD field. Sort on these
fields.
--
Ken Snell
<MS ACCESS MVP>


I have dates in this format - dd/mm/yyyy and I need to
sort the records in date order but just dd/mm and NOT by
the year,Can anyone help please??
Thank you for this site, dont know what i would do
without it.
Evelyn


.
 
Back
Top