First letter from a record in SQL
-
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!