Convert a number from a string into number format

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello -

I have extracted a number from a string and would like to sort on this value
as if it were a number.

In my query I have created a field as follows:

Sort: Format(Trim((Mid([range],2,2))),"#")

This all works except I can not get it to sort in numerical order.

I am getting

9
4
2
17
16
10
1

Thanks!
Sandy
 
Need to convert it to an actual number and not just format it to look like a
number.

Sort: CDbl(Mid([range],2,2))
 
Thanks Jerry!

Jerry Whittle said:
Need to convert it to an actual number and not just format it to look like a
number.

Sort: CDbl(Mid([range],2,2))
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

Sandy said:
Hello -

I have extracted a number from a string and would like to sort on this value
as if it were a number.

In my query I have created a field as follows:

Sort: Format(Trim((Mid([range],2,2))),"#")

This all works except I can not get it to sort in numerical order.

I am getting

9
4
2
17
16
10
1

Thanks!
Sandy
 
Back
Top