Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Jan 2005
    Location
    Wichita, Kansas, USA
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    sorting integers (2000-SR1)

    I have an expression in a query to convert height expressed in inches to be expressed in feet and inches:

    FeetInches: Int([Height]/12) & "' " & ([Height] Mod 12) & """"

    But when I sort by height, 5' 10" (for example) prededes 5' 3" because it looks for the leading number. Is there a way to get it to sort correctly?

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: sorting integers (2000-SR1)

    You are sorting a text field here, which shows the correct sequence.

    Why don't you sort by the variable Height.

  3. #3
    2 Star Lounger
    Join Date
    Jan 2005
    Location
    Wichita, Kansas, USA
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: sorting integers (2000-SR1)

    The data has all been entered in inches only, and the customer wants it reported and sorted by feet and inches now. (And for data entry purposes, "62" is easier to enter than separate fields for feet and inches. I could go back and renter the data into two fields, I guess, if there is no better solution. If there is some syntax that would make the single digit inch results go to two digits then the sorting would work (5' 07" instead of 5' 7", e.g.).

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: sorting integers (2000-SR1)

    There is no point in going back and entering the data again. It has been entered in inches and you have converted that for the report.

    All you need do is to include the inches field in your query, then tell the report program to sort on that field. It does not need to be shown on the report.

  5. #5
    2 Star Lounger
    Join Date
    Jan 2005
    Location
    Wichita, Kansas, USA
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: sorting integers (2000-SR1)

    You are so right--now why didn't I think of that? Thank you sooooo much!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •