BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

please help me ...

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Vicky Verdenga
Guest





PostPosted: Sat Dec 20, 2003 8:34 am    Post subject: please help me ... Reply with quote



hello everybody i have a problem ... i have a field varchar and i want to
isolate the numeric part ...
to be more specific the value of the field is 'PEL-1234', what i want to do
is to keep only the '1234' part ...
the database is sqlserver

sorry for my poor english ...
thank's in advance


Back to top
Andy
Guest





PostPosted: Sat Dec 20, 2003 9:25 am    Post subject: Re: please help me ... Reply with quote



if your data format is consistant ... ie you don't have things like
P2L-1234

you could do something along the lines of ...

var
InputString:String;
NumericPart:String;
x:integer;
begin
NumericPart:='';
InputString:=trim(YourFieldContents);
for x:=1 to length(InputString) do
begin
if InputString[x] in ['0'..'9'] then
NumericPart:=NumericPart + InputString[x];
end;
end;

Andy

"Vicky Verdenga" <vverdenga (AT) algorithmos (DOT) gr> wrote

Quote:
hello everybody i have a problem ... i have a field varchar and i want to
isolate the numeric part ...
to be more specific the value of the field is 'PEL-1234', what i want to
do
is to keep only the '1234' part ...
the database is sqlserver

sorry for my poor english ...
thank's in advance





Back to top
Vicky Verdenga
Guest





PostPosted: Sat Dec 20, 2003 10:16 am    Post subject: Re: please help me ... Reply with quote



thank's a lot Andy ... your help means a lot ..
this lines of code is what exactly i want to do!!!

thank's again


Ο "Andy" <Andy (AT) no (DOT) mail.please> έγραψε στο μήνυμα
news:3fe4156a$1 (AT) newsgroups (DOT) borland.com...
Quote:
if your data format is consistant ... ie you don't have things like
P2L-1234

you could do something along the lines of ...

var
InputString:String;
NumericPart:String;
x:integer;
begin
NumericPart:='';
InputString:=trim(YourFieldContents);
for x:=1 to length(InputString) do
begin
if InputString[x] in ['0'..'9'] then
NumericPart:=NumericPart + InputString[x];
end;
end;

Andy

"Vicky Verdenga" <vverdenga (AT) algorithmos (DOT) gr> wrote in message
news:3fe409a4$1 (AT) newsgroups (DOT) borland.com...
hello everybody i have a problem ... i have a field varchar and i want
to
isolate the numeric part ...
to be more specific the value of the field is 'PEL-1234', what i want to
do
is to keep only the '1234' part ...
the database is sqlserver

sorry for my poor english ...
thank's in advance







Back to top
John Herbster (TeamB)
Guest





PostPosted: Sat Dec 20, 2003 12:35 pm    Post subject: Re: please help me ... Reply with quote

Vicky, Next time please put the subject of your question in
the message subject. It will help attract help. Thanks, JohnH
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.