Pavel Smirnov Posted April 24, 2011 Posted April 24, 2011 field1=numer, field2=date stamp How to find max value of number field by this year? Thank you.
comment Posted April 24, 2011 Posted April 24, 2011 There are many ways to do that. It would be best if you explained the context in which this is needed.
Pavel Smirnov Posted April 25, 2011 Author Posted April 25, 2011 There are many ways to do that. It would be best if you explained the context in which this is needed. each year number value begins from "1" and next number value must be next with increment = 1, but I can't do this with calculation like 'serial number' because if you delete any record, this number value will be lost. I think the best way, is to find max number value, and set field "value+1", but I don't know how to make this script. by clicking a button i need to see in a new record right value.
comment Posted April 25, 2011 Posted April 25, 2011 if you delete any record, this number value will be lost. What exactly should happen if a record is deleted? each year number value begins from "1" This is difficult to implement reliably. What is this number being used for?
Pavel Smirnov Posted April 26, 2011 Author Posted April 26, 2011 What exactly should happen if a record is deleted? This is difficult to implement reliably. What is this number being used for? It's used for numbering documents. So if I need for any record make this document, I need set max value by this year in the related table. So if any record will be deleted in related table (but I think it will be not happened) so next value must be next.
comment Posted April 26, 2011 Posted April 26, 2011 What is this number being used for? It's used for numbering documents. LOL. And numbering documents is used for...? So if any record will be deleted in related table (but I think it will be not happened) so next value must be next. That could mean anything. You didn't mention a related table before. Technically, it's easy to count the number of records in the current year, using a relationship matching on year. The problem is that the number doesn't change until a new record is created and committed - so it's quite possible to generate duplicates.
Recommended Posts
This topic is 5296 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