Reading the first four digits of an 8 digit part n

# Thread: Reading the first four digits of an 8 digit part n

## Reading the first four digits of an 8 digit part n

Hi,<BR><BR>I have some part numbers where the 4 digit prefix is all that I need to identify a part(e.g. 2AG2). However, everyone enters the 8 digit part number into the database (e.g. 2AG2-9001).<BR><BR>There are several 8 digit part numbers for the same part (e.g. 2AG2-5000, 2AG2-0003 etc.) I need to be able to query the database just using the first four digits of the part number. <BR> <BR>People would like to enter either the 8 or just the 4 digit part number. Any ideas???

2. Leungas Guest

## RE: Reading the first four digits of an 8 digit pa

just use left(&#060;digits,4)

3. Chris Bower Guest

## RE: Reading the first four digits of an 8 digit pa

Hey Jason,<BR><BR>To just read the first four digits of a string, you can use the left() function. (Assuming you&#039re using VBScript)<BR>Here&#039s an example:<BR><BR>partNum = "2AG2-5000"<BR><BR>newPartNum = left(partNum, 4)<BR><BR>Now newPartNum is equal to "2AG2"<BR><BR>If you can&#039t get this to work feel free to email me at bower@penguindesign.com<BR>

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•