Skip to Content
0
Former Member
Apr 17, 2014 at 02:43 AM

Refined query for customized numbering

23 Views

Hi,

Below is the query that used to generate a customized number for service call

It was set to auto generate when user select the customer code.

The number will increment only if the service call is created.

Before it has no issue if one user create a service call at one time.

However, I found a issue when A user open a service call and number was generated (ABC0001), user haven't create the service call.

At the meantime, B user also opening a service call and number was generated (ABC001), B user created the service call, following by A user.

So when I run a report, there will be two ABC001.

So wonder is this issue due to query or some other setting ?

Declare @fmt_num as Integer

Select @fmt_num=count(OSCL.CallID) from OSCL

SELECT 'ABC'+ replace(str((@fmt_num)+1,7,0),' ',0)

Thanks