Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Variable alphanumeric sort

Variable alphanumeric sort

Scheduled Pinned Locked Moved Visual Basic
databasejavascript
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jlb
    wrote on last edited by
    #1

    Has anyone got a simple implementation for this :confused: : I'm working on a web site for a client who has some existing data in x999y format where x and y are alpha and 999 is numeric. Each part of the format varies in length. I need to be able to sort in the proper order you would expect so that S11B comes after S1VZ (i.e, 11 > 1). Since this has to run on an ASP page either VBScript or JavaScript would be good (if you can do it in SQL that would be excellent as the DB could do all the work!). I haven't thought of a fast solution - I've had a looooog week and can't think anymore .... :( Thanks in advance, jlb.

    N 1 Reply Last reply
    0
    • J jlb

      Has anyone got a simple implementation for this :confused: : I'm working on a web site for a client who has some existing data in x999y format where x and y are alpha and 999 is numeric. Each part of the format varies in length. I need to be able to sort in the proper order you would expect so that S11B comes after S1VZ (i.e, 11 > 1). Since this has to run on an ASP page either VBScript or JavaScript would be good (if you can do it in SQL that would be excellent as the DB could do all the work!). I haven't thought of a fast solution - I've had a looooog week and can't think anymore .... :( Thanks in advance, jlb.

      N Offline
      N Offline
      Nick Parker
      wrote on last edited by
      #2

      You can do it within the database, in which you may wish to include in your Select statement the same values but put together in another order(i.e. left(some_field, 1) + right(some_field, 1) + substring(some_field, 2, 2)). You would not populate that field, however when the user select the "some_field" column to sort by, you can sort your other column instead. Hope this helps some. Nick Parker

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups