Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Splitting a String for two fields 2

Status
Not open for further replies.

Robin99

Technical User
Apr 8, 2004
19
0
0
US
Hello,

Using CRv10
Data Source: Excel
Data Type: String


I'm trying to show the date of manufacture & the manufacturer of our product using a formula based on their 10 digit serial numbers.
Not sure how to get what I'm after though...

Serial Example: 0436040002
the 1st & 2nd digits represent the year of manufacture - in this case: 2004
the 3rd and 4th digits represent the week of the year - in this case: week 36
the 5th and 6th digits represent the manufacturer - in this case "04" = "Vendor X" (we have a total 4 manufacturers; each with their own 2 digit code)
the remaining 4 digits represent the sequential number the unit was on the production line - in this case, it was the 2nd unit manufactured during week 36

The Desired Result: From the serial number, I'd like to create two separate fields:

Date of Manufacture: Week 36, 2004
Manufactured by: Vendor X

TIA for any help you can provide - Robin
 
You can use the string Left, Mid, and Right functions to extract the year, week, and vendor values in formulas:

Formula for {@week};
Mid(field.table,3,2)

MrBill
 
//@Date_Of_Manufacturer
"Week " & mid({table.field},3,2) & ", 20" & left({table.field},2)

If the century for the year could be 19, then you would need to add some logic there.

//@Vendor
"Vendor " & mid({table.field},5,2)

~Brian
 
Thanks to you both for the fast response. (I've been trying to work this out since 7:30 this morning)
Your suggestions worked perfectly. My report is beautiful; it's on time and my boss thinks I'm a Rock Star!

Thanks again and have a happy holiday!

- Robin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top