Check last value of a field and then increment it by one
Posted: Sun Feb 14, 2010 4:27 am
Hi,
I desperately need some help here. Can anybody tell me how is it possible to check the last value of a field and then increment that value by one and then insert the incremented-value into that field?
Example
Table:Books
Book id - Name - Purchase Year - Accession Number
1 - x - 2000 - 1.2000
2 - y - 2010 - 1.2010
3 - z - 2004 - 1.2004
Now, with the help of a form, the user input the book name and purchase year ( for eg. a,2010). Then a checking needs to be done to get the last value of the accession number field where accession number = ((digit).2010), then add one to that value and gets inserted into the field. So the table becomes.
Book id - Name - Purchase Year - Accession Number
1 - x - 2000 - 1.2000
2 - y - 2010 - 1.2010
3 - z - 2004 - 1.2004
4 - a - 2010 - 2.2010
Please tell me if there is any confusion as I need this solution urgently...Thank you
I desperately need some help here. Can anybody tell me how is it possible to check the last value of a field and then increment that value by one and then insert the incremented-value into that field?
Example
Table:Books
Book id - Name - Purchase Year - Accession Number
1 - x - 2000 - 1.2000
2 - y - 2010 - 1.2010
3 - z - 2004 - 1.2004
Now, with the help of a form, the user input the book name and purchase year ( for eg. a,2010). Then a checking needs to be done to get the last value of the accession number field where accession number = ((digit).2010), then add one to that value and gets inserted into the field. So the table becomes.
Book id - Name - Purchase Year - Accession Number
1 - x - 2000 - 1.2000
2 - y - 2010 - 1.2010
3 - z - 2004 - 1.2004
4 - a - 2010 - 2.2010
Please tell me if there is any confusion as I need this solution urgently...Thank you