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. Comparing strings with variable lengths/misspells/...

Comparing strings with variable lengths/misspells/...

Scheduled Pinned Locked Moved Visual Basic
csharpdatabasehelpcareer
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.
  • M Offline
    M Offline
    mayhem_rules
    wrote on last edited by
    #1

    VB.NET/MS ACCESS/SQL Consider the following data: No Name Salary 1 Shawn DSouza I 4000 2 sHAWN D'Souza I 3000 3 Shaw-n DSouza I 2000 The above data is almost similar other that the cases or typing errors or maybe different ways of writing similar things. The data I have contain several such records. What I need to do is group such records together and filter out one record with the highest salary. It seems like we need to apply some intelligent search ! Can someone help me with this. With Best Regards, Mayur

    D 1 Reply Last reply
    0
    • M mayhem_rules

      VB.NET/MS ACCESS/SQL Consider the following data: No Name Salary 1 Shawn DSouza I 4000 2 sHAWN D'Souza I 3000 3 Shaw-n DSouza I 2000 The above data is almost similar other that the cases or typing errors or maybe different ways of writing similar things. The data I have contain several such records. What I need to do is group such records together and filter out one record with the highest salary. It seems like we need to apply some intelligent search ! Can someone help me with this. With Best Regards, Mayur

      D Offline
      D Offline
      dptalt
      wrote on last edited by
      #2

      If I understand your question correctly you want to group the same name records together even if the spelling of the name is different and then find the highest salary record from that group. First convert the name field to lower case. Then you will have to define a set of characters the can be savely removed from the name field. In that set you could include dash (-), quote ('), and space ( ). For each name remove those characters. This will attempt to convert similiar names to the same name. The way to find the highest salary kind of depends on how the data is stored. If it is in a datatable you can query records returning the highest value in the salary field. Or sort the records by salary in desc order putting the highest value in row 0. Or you can process the records one by one in a for next loop to find the highest salary. I hope this helps!

      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