I would like to create a function that returns a new order number based on the parameter that I give it for a previous order number. Here is an example:
Old order number: RS001-00000013
New order number desired from function: RS001-00000014
The "RS001" means "Retail Sale" from location number "001". All of these types of orders that I want to run through this will begin with "RS".
I would like to insert a parameter value of RS001-00000013 and get RS001-00000014.
Alternatively I would like to enter a value of RS002-00000009 and get RS002-00000010.
I had some ideas about a scalar-value function, but I'm pretty new to functions. I'm pretty experienced with T-SQL statements in general, but the syntax of functions wierds me out because I haven't been exposed to them very much.
Anyone have any ideas?
Thank you in advance for any and all suggestions.