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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add order By the back door

Status
Not open for further replies.

TheKnee

Programmer
Feb 17, 2005
33
CA
I would like to add order in the sop table by SQL querry
what is the best way to get next order number available?

 
You could just run a "SELECT * FROM SOP----- ORDER BY SOPNUMBE" and take the highest SO Number and add +1 to it. That will create the most recent SO.

Brad [spidey]
 
Is there any chance that someone could take the same number as me...
 
If you add your order right away, you should be ok. If you end up waiting for a little bit though, you might want to go back and check to see if the number has been used or not. What exactly are you trying to do or add to the tables?
 
I build a transcational web site and i whant to send the order directly to GP with out type it human action

 
Well, if you create a stored procedure, the procedure could then find the most current available SO number, add 1 to it, and create the SO right there. It would be done so quickly, the number could not be taken by someone else. I have a customization in GP that takes the transfer number and adds 1 to it to get the most recent and haven't had any troubles with it thus far.

Brad [spidey]
 
make an algorythm for your SOP# selection.

ie

August 10, 2005 11:10am

SO-810051110



-----------
and they wonder why they call it Great Pains!

jaz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top