dbTalk Databases Forums  

Advice Requested: Customer Code String

comp.databases.filemaker comp.databases.filemaker


Discuss Advice Requested: Customer Code String in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
NathanB
 
Posts: n/a

Default Advice Requested: Customer Code String - 11-07-2005 , 05:02 AM






Hi there,

I have been requested to develop a simple Filemaker database, however I
am native to Access.

A unique customer code is required to be generated by Filemaker. The
customer code is structured as follows:
First 3 characters of customer name, then last character of customer
name then a 2 digit serial number.

i.e. KENTUCKY FRIED CHICKEN would be KENN01

If another company was added which resulted in KENN then the serial
number should increment to 02 (i.e. KENN02).

The serial number should always default to 01 for all new customers
unless the customer code already exists.

Basically I can easily extract the alphabetic characters using left()
and right() functions. I am not sure how to approach the serial
number.

How can I check for a duplicate when creating a new customer code and
then increment the serial number if a duplicate exists?

Any advice will be much appreciated.

Regards,
Nathan


Reply With Quote
  #2  
Old   
FP
 
Posts: n/a

Default Re: Advice Requested: Customer Code String - 11-07-2005 , 09:18 PM






Normally you would do this just using a serial number.
I assume the record creation is scripted so that even if the company
name changes your primary key doesn't... otherwise you have real
issues.

There's a couple of ways to do what your asking, the easiest is to
search for any matching records once you have your key without the
numeric portion, sort the records and increment 1 to the value of the
last found record. If you do all this in a new window and close the
window again you won't screwup your found set.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.