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. Database & SysAdmin
  3. Database
  4. First letter from a record in SQL

First letter from a record in SQL

Scheduled Pinned Locked Moved Database
databasehelpquestion
1 Posts 1 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.
  • R Offline
    R Offline
    Robby
    wrote on last edited by
    #1

    Hello, I am trying to figure out a way to get different characters from different fields to auto-produce a string to display to a user on a web page. For instance, if you enter your name as John Doe and your SSN is 000-00-1234, then I want to be able to go to the firstName, lastName and SSN fields and get only the FIRST letter of the firstName & lastName and the LAST three of the SSN and put them together and add them to the userID field in the table (i.e. JD234). Right now, the SSN fields are split as ssn1, ssn2, ssn3, and are combined and entered into the SSN field as xxx-xx-xxxx. I would also like the capabilities of creating an ID based on two different things. For instance, if they supply an employee number INSTEAD of an SSN (we are currently changing our ID naming scheme, but not enforcing it at this time), then I would like to take the FIRST letter of the firstName and the last (6) of the employeeID and create the userID from that...do I use an If...Then...Else to see which they entered and produce the ID? Keep in mind that I want to do ONE of the OTHER, but the new scheme (using the employeeID field) takes precedence. Anybody out there done this before?? Thanks for your help!

    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