Where are you getting the contents of the DATE field? Do you perhaps need the current date? Is DATE a field in the same table?
That was it thank you. Is there a way now to make it a 2 digit month and a 2 digit year?
What was it? I ask because if you want this unique ID to "stick" for historical purposes it must be stored.
I actually Figured it out the ID for every record is different so my full line of code is as follows
Right ( "0" & Month ( DATE ) ; 2 ) & Right ( "0" & Year ( DATE ) ; 2 ) & "-" & ID
So I get something that looks like
It only makes this when the record is first created
Seems to be working then. How is your field "DATE" defined?
Is ID defined as an auto-entered serial number? If it is, then just the ID alone uniquely identifies each record. There is no real need to "encoude" date information as part of the ID.
And what you have is not the best ID setup for linking tables in relationships--though there are often other needs for such an identifier.
I have 3 main tables in my database, Service Tickets, Quotes and Fire Inspections and these tables not only have an ID Number that is autoenterd serial number but a Unique reference number.
Service tickets have the Month and ID Number, So we can reference when in the year we did it.
Quotes have a Month Year and ID number so we can reference just by looking at it when it was done.
Fire Inspections have a Month Year and Account Number (Unique to every account that is attached) But there is no ID number on this one because I have them being done offline on Filemaker go and then the Records are imported to the Hosted File then they get an ID Number. This way There will not be Multiple Same ID Numbers being created by different people out in the Field but the Reference number will stay the same.
I am Fairly new to all this and my stuff may not look pretty but it seems to be working Am I doing something Wrong or I am sure there is a better way to do it?
Am I doing something Wrong or I am sure there is a better way to do it?
What I posted were words of caution. Use your unique auto-entered serial number to link to other tables in relationships. Use the "encoded meaning" ID's discussed here as data fields to be used for labeling, searching, Reporting etc, just not as a Primary Key in your data model.