Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Splitting a single field into two based on upper character occurrence

Status
Not open for further replies.

nemmeh

Technical User
Jul 7, 2003
30
US
Hey everyone,

Need a little help with creating a query to split some data. If there was a common character associated with this field then using the substring and trim functions would probably allow me to do this, however my sql is a little rusty when it comes to this nature of things.

I've basically got a single field that contains a list of names, the data should really be split into two separate fields called FirstName and LastName. At the moment, the data is at least consistent in the overall scheme that the FirstName and LastName start with capitals.

Example:

JohnDoe
JaneDoe
RayWoodie
ToddEmrich

etc....
As you can see the consistency is there that I believe I should be able to just construct a query using some type of functions to just set the first upper letter then the lower string immediately following until another upper is hit. As far as actually constructing this query is where I get lost as I'm not familiar with the functions that I would need to use to grab just that segment of data.

Can anyone offer some advice of which functions and/or possibly throw a quick query together to split the data for me?

Btw, the database that i'm working with is a borland (paradox) type so some of the more common t-sql functions may not be supported.

Thanks,

Nem
 
You *are* using Paradox tables? (.db files)

Are you using Paradox the Application? "common t-sql functions" tells me maybe not.

Tony McGuire
"It's not about having enough time. It's about priorities.
 
Yes, I am using paradox (.db) tables. The application that the database is actually for is written in delphi. I basically have a table browser utility which allows me to execute sql commands on the tables.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top