display info before a space [message #20116] |
Tue, 30 April 2002 05:05 |
Michael
Messages: 61 Registered: October 1999
|
Member |
|
|
Assume a DB:
Name
Smith J B
Jones A X
I want to display surnames only
I have tried:
Select substring(name from 1 for position(' ' in name))
from name
But it just brings up 'invalid number'
I've tried other methods but it seems that the problem is - the 'position' function relates to the starting position of a substring and I want to specify the end.
I've even tried taking the 'J B' substring away from Smith J B - that doesn't work either.
Any ideas?
|
|
|
Re: display info before a space [message #20117 is a reply to message #20116] |
Tue, 30 April 2002 05:16 |
Mosquito
Messages: 6 Registered: April 2002
|
Junior Member |
|
|
This doesn't exactly fit your problem description, but if you have to seperate names and surnames alot, maybe the most efficient thing would be to have them apart. One collumn for names and another for surnames.
|
|
|
|