Extracting Data 
Author Message
 Extracting Data

Hi Liz,

To separate part of string you can use SUBSTRING T-SQL
function and conver numeric string into numeric value
usong CONVERT function. It could look like

SELECT CONVERT(INT, SUBSTING(FieldName, 4,3)) as
NumerResult ORDER BY NumerResult

but that way will work only in case if numeric value
starts from position 4 and has leght of 3 characters (like
ABC123DEF). In case of different position of numeric
values in field value, you will need to scan value to find
first and last postion of numeric value

Val

Quote:
>-----Original Message-----
>Good Morning,

>I am writing a SQL program and I need to extract a field
>in order to sort it properly.  The field contain alpha
and
>numeric numbers for example TPP123ABC, APCD18BCD,
BBBKL1LL
>are some examples of how the data looks.  The sort is
>really off.  What I want to do is separate the character
>from the number and please them into variable for example
>TPP in a variable the 123 in another and ABC in another.  
>By during this way it would help me to sort the data and
>piece them back together.  If anybody have and
suggestion,
>please let me know.  
>.



Tue, 31 Aug 2004 23:12:43 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Extracting data from a sub form

2. Extracting data from a report into a table

3. Extracting data from OLE type in a recordset

4. Opening and Extracting Data from Outlook Messages

5. extracting data from olMeetingResponsePositive

6. Extracting data from listbox into MSFlexGrid

7. HELP: Extracting data from remote oracle server to excel

8. Extracting data from HTML documents using Excel

9. Extracting data from embedded XML tags in Outlook e-mails

10. Extracting data from Outlook

11. Extracting data from a custome field

12. extracting data from an excel spreadsheet into vba code

 

 
Powered by phpBB® Forum Software