sorting with group filter on Data Access Page

R

Robert

I have a group filter control (drop-down list) on DAP that
uses date from records that are in text format (Jan-04,
Feb-04, etc). The group filter was created by clicking
Drop-down box on tools then right clicking "Period" field
in table list and draging to DAP. The records are grouped
by Period (Jan-04, Feb-04......Jan-05, etc. The problem
is sorting in control. Rather than sort as records are
stored ( Jan-04, Feb-04,........Jan-05), the control sorts
in ascending order,i.e., Jan-04, Jan-05, Feb-04, etc.

How can I sort on records as stored, rather than ascending
or descending order?
 
M

Michel Walsh

Hi,


I would try to sort on the computed expression:

CDate( "1-" & GroupDate)


assuming your actual data is under the field GroupDate. I assumed the
suffix, 04, 05, are year, not day, in Jan-04, Feb-04, Jan-05. The
concatenation with "1-" will then make the date the "first of " & "
January 2004", which, I also assumed, will be picked up correctly with your
regional setting (should, if it can decode Jan as January; may not work in
Italia, Spain, France, Germany,... since there, the short month names are
not Jan, Feb, ... but you did not specify the context).



Hoping it may help,
Vanderghast, Access MVP
 

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

Top