| View previous topic :: View next topic |
| Author |
Message |
Vicky Verdenga Guest
|
Posted: Sat Dec 20, 2003 8:34 am Post subject: please help me ... |
|
|
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
|
Posted: Sat Dec 20, 2003 9:25 am Post subject: Re: please help me ... |
|
|
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
|
Posted: Sat Dec 20, 2003 10:16 am Post subject: Re: please help me ... |
|
|
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
|
Posted: Sat Dec 20, 2003 12:35 pm Post subject: Re: please help me ... |
|
|
Vicky, Next time please put the subject of your question in
the message subject. It will help attract help. Thanks, JohnH
|
|
| Back to top |
|
 |
|