Hi Friends,
My problem is this. My client is want automatic item code generation so how I can do this can you please suggest me.
Request clarification before answering.
Hi Naveen.......
Try this and just replace the '?' by your alphabets before code number as per your requirement.....
declare @temp as char(15)
IF ($[OITM.ItemType]) = 'I' And ($[OITM.ItmsGrpCod]) =100
BEGIN
set @temp=(select max(right(itemcode,6)) + 1 from oitm where
(itemtype='I') and (len(itemcode)=11) and (left(itemcode,5)='?'))
set @temp='?'+isnull(replicate(0,6-len(@temp)),'')+@temp
select isnull(cast(@temp as char(15)),'?000001')
ENDHope this will help you.......
Regards,
Rahul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 14 | |
| 13 | |
| 7 | |
| 7 | |
| 5 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.