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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generate ID using parts of other records

Status
Not open for further replies.

ali32j

Technical User
Joined
Apr 23, 2007
Messages
97
Location
GB
Hi All

I m looking to use an update query to generate a ID against each customer, i want to use the following

Region Name PostCode
EPEG ROCALLER ELECTRONICS LTD FG40 4RF

I want the ID generated to be:

EPEGFG404ROCALLELECTRO

So it would take all of the region record, 6 letters of first and second words in Name record and 5 digits of the postcode ignring the space...

I know how to do this in excel, but at a loss with a query, and what code i would need

Can anyone help??

Ali
 
Hi Remou

Please accept apologies for delay, i should have given more details and the above is quite right, i need the following:

1. region

2. All of the first part of post code regardless of length (which varies, it could be 3 digits or 4, PO3 or PO34) + first letter after the space in postcode

3. All of the first part of company name regardless of length and only 6 digits of the second part of company name (but needs to ignore it if second part is LTD)

SOrry i did not develop such a complex ID but short changing the a whole companies ID structure i have to abide by it

Would appreciate any help you could offer

Thanks

Ali

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top