Sort a report

X

xp

I have a report based on a table and the "Order By" property for the report
is set to "User_Name, Voucher, Line". This sort works great except that
"Line" sorts as follows: 1, 10, 11, 12, 2, 3, etc.

What can I set the "Order by" property to in order for this data to sort
correctly?

Thanks for the assistance!
 
J

John Spencer MVP

The line value is a text value that is composed of number characters. So you
can either change the query by wrapping the line value in the Val function or
one of the conversion functions (CLng, CInt, CDbl)

0r you can set the ORDER udinh the Val function

Val(Line)

If you are using the reports Sorting and Grouping dialog (View: Sorting and
Grouping...) then you need to enter
=Val(Line)
into the Field/Expression column.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 

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