in my database, i have the user put in people's name as a field. ex. "Micheal Johnson", i would like to sort all of the database using people's last name. I dont know how to do this with sql.
Printable View
in my database, i have the user put in people's name as a field. ex. "Micheal Johnson", i would like to sort all of the database using people's last name. I dont know how to do this with sql.
Add a field to your table for storing Last name (or replace the single name field with 2 or 3 ).
thanks for replying but that cannot be done because my program mostly based on full name...
Yes it can be done, you just need to concatenate the fields together when you retrieve the data. Let's assume you've used Name as your current field.
Change the name of "Name" to "lastname" in your database.
If you add two more fields, "firstname" and "initial".
To retrieve all the following fields in one, use the following SQL:
select firstname + ' ' + initial + ' ' + lastname as name from table