|
-
Aug 18th, 2000, 12:56 PM
#1
Thread Starter
Lively Member
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.
-
Aug 18th, 2000, 01:13 PM
#2
Frenzied Member
Add a field to your table for storing Last name (or replace the single name field with 2 or 3 ).
-
Aug 18th, 2000, 01:41 PM
#3
Thread Starter
Lively Member
thanks for replying but that cannot be done because my program mostly based on full name...
-
Aug 18th, 2000, 02:32 PM
#4
Frenzied Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|