Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with Numbering system

Status
Not open for further replies.

machtenx

IS-IT--Management
Dec 2, 2003
54
0
0
US
I have a purchasing system which has a PO Number composed of the date, purchaser's initials, and if it is a second PO for the day it becomes 1, 2, 3, and so on.

So, for example if on 7/29/2004, Bob Thornton was going to make his second purchase order form of the day, his PO number would be 72904-BT2

I've automated it with a calculation up to the point of 72904-BT but I can't figure out how to get the 1, 2

Can anyone help me? thanks so much
 
If you really want to go this route, there are different ways to go.
Basically you need to set up a relationship linking the PO numbers and use that to set up a conditional serial link.

Here is a rough sketch of one approach. Not that simple and easy...but not bad.

You have to script it....
You need a field Po sequence (to hold your 1, 2, 3 .....) make it a simple number field.
Make a self relationship between PO number = PO number. PO Final)
What you would like is making PO Sequence the max of the related PO numbers +1.

Make a script : set Final PO = Set Field (PO sequence; Case(
POFinal::posequence > 0;POFinal::posequence+1;1)

Play around with your field by concatenate them until you have your desired result, something in the line of : PO number & “ – “ & PO sequence

HTH

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top