Skip to Content
0
Former Member
Jul 14, 2011 at 02:37 PM

Auto Code Generation

18 Views

Experts,

BP - V00000000000001 - V00000000001315 - Last No. Vendor

BP - C00000000000001 - C00000000039861 - Last No. Customer

Item - 1000000001 - 1000016632 - Last No.

For generating auto code for this

SELECT

CASE $[$40.0]

When 'C' then 'C

'When 'L' then 'L'

When 'S' then 'V'

ENDIsnull(Substring(Str(100000Max(Right(T0.CardCode,5))+1,6),2,5),'00001')

FROM OCRD T0

WHERE T0.CardCode like '%[0-9][0-9][0-9][0-9][0-9]'AND T0.CardType = $[$40.0]

I am using this, am i going right? it is not giving any value...