PHP2005 Posted October 15, 2007 Posted October 15, 2007 Hi All, I have a field called “b_number”, how do I write a scrip asking to find the biggest number at b_number field andafter found I will have the add from the b_number +1 added at b_number. Any help will be appreciated. Thank you in advance. ;)
LaRetta Posted October 15, 2007 Posted October 15, 2007 asking to find the biggest number at b_number field andafter found I will have the add from the b_number +1 added at b_number. Why not just use an auto-enter serial number? It would save a lot of work. Can you say a bit more about what you are doing and why? What is that b_number?
PHP2005 Posted October 15, 2007 Author Posted October 15, 2007 I do have a field with an auto serial number. b_number is to used for a receipt number when people paid in full so each time someone paid I have to print a receipt but it have to be in a serial number.
comment Posted October 15, 2007 Posted October 15, 2007 I think you should have a separate table for receipts.
Fitch Posted October 15, 2007 Posted October 15, 2007 (edited) A couple of ways to solve this: 1. Use a relationship and a calc: Max(related:_number)+1 2. Or, use a script something like: Show All Go to record(last) Set variable($theBiggest;b_number) New record Set field(b_number;$theBiggest+1) Edited October 15, 2007 by Guest Why does this forum sometimes break text apart?
Recommended Posts
This topic is 6250 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