I want to know how can I get the year and month into my database. For example, suppose it’s August, 2011. The output that I need is like this: CAB 11 08 001 (CA
CAB 11 08 001
SELECT 'CAB' + RIGHT(YEAR(GetDate()),2) + RIGHT('0' + CONVERT(VARCHAR, MONTH(GetDate())),2) + Right('00000' + Cast(CurrentNo as varchar(10)), 5)
That might work..