jpkrey Posted December 22, 2000 Posted December 22, 2000 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.
Kurt Knippel Posted December 23, 2000 Posted December 23, 2000 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 =-=-=-=-=-=-=-=-=-=-=-=-=
jpkrey Posted December 23, 2000 Author Posted December 23, 2000 Thank you. How do you check to see if the relationship is valid? This is new idea to me.
Chuck Posted December 23, 2000 Posted December 23, 2000 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
Recommended Posts
This topic is 9006 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now