December 22, 200025 yr I have a service call database. I need to assign a unique number for each call. The first part of the number is the date. The second part of the number is to be the number of calls taken that day up to that point. So, the first call on January 4th 2001 will be #010104-001. The fifth call on that day will be #010104-005. The second call on January 5th 2001 will be #010105-002. Any clues on how to generate that 001, 002, 003 sequence and then restarting the next day automatically. Thanks.
December 23, 200025 yr quote: Originally posted by jpkrey: I have a service call database. I need to assign a unique number for each call. The first part of the number is the date. The second part of the number is to be the number of calls taken that day up to that point. So, the first call on January 4th 2001 will be #010104-001. The fifth call on that day will be #010104-005. The second call on January 5th 2001 will be #010105-002. Any clues on how to generate that 001, 002, 003 sequence and then restarting the next day automatically. First setup a date field and a sequence field. Setup a relationship by today's date to the date field, sorted by the sequence number, in descending order (i.e. highest first). Then when creating records, check this relationship. If it is not valid (i.e. this will be the first record of the day) assign your call number as date & "001". If the relationship is valid, then assign your call number as date & sequence number + 1. ------------------ =-=-=-=-=-=-=-=-=-=-=-=-= Kurt Knippel Consultant Database Resources mailto:[email protected] http://www.database-resources.com =-=-=-=-=-=-=-=-=-=-=-=-=
December 23, 200025 yr Author Thank you. How do you check to see if the relationship is valid? This is new idea to me.
December 23, 200025 yr There's a function called IsValid which takes as its argument a related field and returns true if there's a valid relationship for the current record. Chuck
Create an account or sign in to comment