[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Craig

3/30/2007 8:54:00 AM

Hi, I have a table with a field Address containing 1 string, but uses
commas to distinguish between road, city, county etc.

I need to build a view that has Address1, Address2, Address3, Address4,
Address5. Is there a simple way to add to my select statement "SELECT
FIRSTNAME, LASTNAME, ADDRESS, POSTCODE FROM PEOPLE" to something like
"SELECT FIRSTNAME, LASTNAME, BeforeFirstComma(ADDRESS) AS ADDRESS1,
BetweenFirstAndSecondComma(ADDRESS) AS ADDRESS2 etc., POSTCODE FROM PEOPLE"

many thanks.
2 Answers

xyb

3/30/2007 9:28:00 AM

0

On 3?30?, ??4?53?, Craig <c...@somerubbish.com> wrote:
> Hi, I have a table with a field Address containing 1 string, but uses
> commas to distinguish between road, city, county etc.
>
> I need to build a view that has Address1, Address2, Address3, Address4,
> Address5. Is there a simple way to add to my select statement "SELECT
> FIRSTNAME, LASTNAME, ADDRESS, POSTCODE FROM PEOPLE" to something like
> "SELECT FIRSTNAME, LASTNAME, BeforeFirstComma(ADDRESS) AS ADDRESS1,
> BetweenFirstAndSecondComma(ADDRESS) AS ADDRESS2 etc., POSTCODE FROM PEOPLE"
>
> many thanks.

google this pub for split string and UDF :)

Craig

4/1/2007 12:15:00 PM

0

Hi,

I guess you're pointing me to the uf_Split function, which I've added,
but I'm having some problems embedding it into my query. Any chance of
another pointer please.

many thanks,
craig

xyb wrote:
> On 3??30è?, ????4ê±53·?, Craig <c...@somerubbish.com> wrote:
>> Hi, I have a table with a field Address containing 1 string, but uses
>> commas to distinguish between road, city, county etc.
>>
>> I need to build a view that has Address1, Address2, Address3, Address4,
>> Address5. Is there a simple way to add to my select statement "SELECT
>> FIRSTNAME, LASTNAME, ADDRESS, POSTCODE FROM PEOPLE" to something like
>> "SELECT FIRSTNAME, LASTNAME, BeforeFirstComma(ADDRESS) AS ADDRESS1,
>> BetweenFirstAndSecondComma(ADDRESS) AS ADDRESS2 etc., POSTCODE FROM PEOPLE"
>>
>> many thanks.
>
> google this pub for split string and UDF :)
>