hide the "0" at left

K

kendo

i'm building a table of adress, and wanted to build a corresponding report,
but I have the following problem:
I wanted the order the records by door number, and when I do it, the records
will only be realy ordered if I put the "0's" at left (ex: 001, 022,111).
I was trying to hide the "0" in the report but can't find out how to.
does anyone know how to do it?
 
K

Ken Snell [MVP]

You don't give us much to go on, but you could add a calculated field to the
query similar to this:
SortField: Val([DoorNumber])
and sort Ascending on this field.

It sounds as if the DoorNumber field is a text field, so your sort on that
field goes with text sorting, not numeric value sorting.
 
B

Brendan Reynolds

For demonstration purposes, I've used the Intermediate window ...

? cstr(val("012"))
12

.... In the Control Source property of a text box, it would looks something
like ...

= CStr(Val([DoorNumber]))

The CStr function isn't strictly necessary in most circumstances, you can
probably get away with just =Val([DoorNumber]). Val returns a Double, which
may or may not be important, depending on the circumstances. Use CStr when
you need to explicitly convert the return value back to a String again.
 
Top