dbTalk Databases Forums  

Verify double field oneness

comp.databases.filemaker comp.databases.filemaker


Discuss Verify double field oneness in the comp.databases.filemaker forum.



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

Default Verify double field oneness - 06-03-2010 , 10:01 AM






Ho can I verify that a value is existing in combination with another
field value? I think I'll explain better with an example:

field 1 -> year (four digit)
field 2 -> code (number between 0001 and 9999)

I want that the same year I can't use the seme code, but every year the
code should leave again from 1.
With the two fields I creatre an 8 digit serial number, that is year &
code, that must be unique, but I won't input serial number and calculate
the other two fields.

--
Per rispondere, togliere -NOSPAM- dall'indirizzo.

Reply With Quote
  #2  
Old   
Your Name
 
Posts: n/a

Default Re: Verify double field oneness - 06-04-2010 , 01:30 AM






"Aladino" <borgobello-NO (AT) SPAM-alice (DOT) it> wrote

Quote:
Ho can I verify that a value is existing in combination with another
field value? I think I'll explain better with an example:

field 1 -> year (four digit)
field 2 -> code (number between 0001 and 9999)

I want that the same year I can't use the seme code, but every year the
code should leave again from 1.
With the two fields I creatre an 8 digit serial number, that is year &
code, that must be unique, but I won't input serial number and calculate
the other two fields.
To do this you will need to define a Relationship, within the same Table,
based on the Year field to group together all records of the same Year.
e.g.
rel_SameYear Match records in TableA with records in TableA
When Year = TableA::Year

From this you can then create the Code field which finds the maximum* value
of the existing Codes for the same Year and add 1 to that.
e.g.
Code Number
Auto-enter by Calculation
= Max(rel_SameYear::Field1) + 1

* Note: You can't use the Count function here because that would cause
duplicate codes when a Related Record is deleted.

Helpfull Harry )

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.