Select Right in update Query

  • Thread starter Thread starter TVining
  • Start date Start date
T

TVining

I have forgotten a much-used, very important piece of SQL code! :mad:

I have the following fields: (Sample Data in Parenths)
Last Name (Smith)
First Name (John)
Social (993999933)

And In the same table, I need to make the following fields:
Laundry Mark (S9933)
Last 4 (9933)

Laundry Mark is first letter of the Last name plus Last 4 of Social
Last 4 is obvious.

I know it's a combination of SELECT RIGHT and SELECT LEFT, but ca
someone throw together a sample and email or forum it? Thanks!

TV send
 
Assuming Social is a Text field:

LaundryMark: Left([Last Name], 1) & Right([Social], 4)
Last4: Right([Social], 4)

If it's a Numeric field, use the Format statement to convert it to a 9
character string first:

LaundryMark: Left([Last Name], 1) & Right(Format([Social], "000000000"), 4)
Last4: Right(Format([Social], "000000000"), 4)
 
Back
Top