New call-to-action
Results 1 to 3 of 3

Thread: Indexing character field

  1. #1
    Member
    Real Name
    Michael Mowat
    Join Date
    Oct 2002
    Location
    Cochrane, Alberta
    Posts
    41

    Default Indexing character field

    I have a character field called "location". The field will read "Box 1, Box 2, Box 3, and so on to approx 60. When the database is indexed on this field, for example to print a report or perform a query or range, they are indexed as follows; Box 1, Box 10, Box 11,... up to Box 19, then Box 2,
    Box 20, Box 21, Box 22,... Is there a way to write a script to force the database to be indexed the way I need it to be?
    Box 1, Box 2, Box 3...
    Thanks in advance

  2. #2
    Member
    Real Name
    Allen Klimeck
    Join Date
    Apr 2000
    Location
    Colorado
    Posts
    549

    Default RE: Indexing character field

    Change (Box 1 through Box 9) to (Box 01 through Box 09) and it will index correctly.

  3. #3
    "Certified" Alphaholic Melvin Davidson's Avatar
    Real Name
    Melvin Davidson
    Join Date
    Apr 2000
    Location
    Parker, CO
    Posts
    1,197

    Default RE: Indexing character field

    There are two solutions.

    Unless the field always starts with "BOX", I'm guessing it
    does not, you should break it up into two fields:
    eg: Box_Alpha & Box_Numeric.
    Then your index would be BOX_ALPHA + STR(VAL(BOX_NUMERIC))

    otherwise
    LEFT(CHAR_BOX, 3)+ STR(VAL(RIGHT(CHAR_BOX, 6)),6)

    Also works.

    regards,
    Melvin Davidson

Similar Threads

  1. Character field doesn't increase
    By Mike Vance in forum Alpha Five Version 6
    Replies: 3
    Last Post: 05-18-2005, 12:30 AM
  2. import a numeric field into a character field
    By dcorcoran in forum Alpha Five Version 6
    Replies: 5
    Last Post: 04-02-2005, 08:44 AM
  3. Character Field
    By deputy956 in forum Alpha Five Version 5
    Replies: 4
    Last Post: 11-16-2004, 03:02 PM
  4. Transform character field to date field, how ?
    By mronck in forum Alpha Five Version 5
    Replies: 9
    Last Post: 11-11-2003, 11:38 AM
  5. Parsing a Character Field
    By Tom Patten in forum Alpha Five Version 4
    Replies: 9
    Last Post: 05-15-2002, 05:46 PM

Bookmarks

Posting Permissions

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