Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Upper Case separation

Author  Topic 

matt.orme
Starting Member

23 Posts

Posted - 2008-03-26 : 13:25:09
I am new to SQL and, unfortunately, actually do my work in Access 2003, but I have a question.

This is an example of what the data I am working with looks like:

AALADIN
AA-TACH EH65X, EH65V (V-Twin)
AA-TACH w/Robin 20 & 20.5 h.p. OHV
AA-TACH w/Wisc.-Robin EY21
ABI CONTRACTOR w/Honda 20 h.p. (V-Twin)

The all caps text strings at the beginning of the field need to end up in a separate field than the mixed strings, and the mixed strings need to stay together. The field length varies, as do the lengths of the all caps text strings. There are a lot of records, so I would be interested to know if there was a way to proceed without manually editing each line.

The

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2008-03-26 : 13:53:32
Is this question for Sql Server or for Access? If you are doing this work in access you should post the question in the MSAccess forum.

Be One with the Optimizer
TG
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2008-03-26 : 14:09:22
How do you want the rows split
e.g.
AA-TACH EH65X, EH65V (V-Twin)
do you want
'AA-TACH EH65X, EH65V (V-', 'Twin)'

I doubt it.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

matt.orme
Starting Member

23 Posts

Posted - 2008-03-26 : 14:14:00
Sorry about posting to the wrong area. I am new to this. I am writing everything in SQL view, so I thought this was the right place.

I want the entries to be split like this:

(AA-TACH EH65X) (EH65V (V-Twin))
(AA-TACH) (w/Robin 20 & 20.5 h.p. OHV)
(AA-TACH) (w/Wisc.-Robin EY21)
(ABI CONTRACTOR) (w/Honda 20 h.p. (V-Twin))

Thanks for your help
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-03-26 : 14:27:28
Oh, either ", " (comma&space) or " " before "w/" is a separator?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

matt.orme
Starting Member

23 Posts

Posted - 2008-03-26 : 14:35:46
The comma is the exception to the rule. The data isn't perfectly consistent. For example, here is another section of the same column -

BOBCAT (Also, See Melroe) w/Onan CCK
BOBCAT (Also, See Melroe) w/Onan CCK
BOBCAT Edger/Trimmers
BOBCAT Edger/Trimmers
BOBCAT w/B&S 18 h.p. (Twin)

The one constant is that there is a text string, sometimes containing more than one word, that is in all caps. That is the string I would like to isolate into a new field.

Thanks again
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2008-03-26 : 14:46:22
maybe you want to isolate up to the first string that contains a lower case or not '-' or space or after current string is terminated by a comma.


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

matt.orme
Starting Member

23 Posts

Posted - 2008-03-26 : 14:54:05
Isolating up to the first string that contains a lower case would be perfect! How is that done?
Go to Top of Page
   

- Advertisement -