on 06-16-2011 4:39 AM
Hi all,
I have a problem in creating auto numbering in BP for Customer type using Formatted search
My query is like this
declare @tempNo as char(20)
set @tempNo=(select Isnull(max(REPLACE(OCRD.CardCode , LEFT(OCRD.CardCode,10),'')),0) + 1
from OCRD where (CardType ='C') and LEFT(OCRD.CardCode,3) = 'CU.' )
set @tempNo='CU.'left(convert(varchar,GETDATE(),112),6)'.'+@tempNo
select cast(@tempNo as char(20))
It should be creating the new number for example
CU.201101.1
CU.201102.2
CU.201103.3
CU.201103.4
The format will be like this CU.YYYYMM.autonumbering
So if the current year is still the same it will always increase the number and it will reset the number become 1 if the current year is change.
But when i execute the number , the number doesn't increase, still generate the last number CU.201103.4
I have use this query in generate item number, it runs well but different format.
Is there some thing wrong with my query?
Thanks in advance
Regards
Jia shun
Hi Jia shun,
You have posted an identical threads. There is no such need. Please close this one and response to the one with answer already.
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
9 | |
9 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.