i have MAX CODE of 519999
and when i add 1 to this code.. it becomes 520000
Although i want to add only the rest 4 DIGIT(9999) to 1 NOT 51
so that it give me 5110000 (adding Dynamically)
I HAVE THE FOLLOWING Query.. Plz Help to Get the Desire Result..
@Branch=51
and Max CODE is 519999
SELECT @Code = @Branch + RIGHT(MAX(Code) ,@DIFAG) + 1
FROM tblmember (NOLOCK) WHERE LEFT(Code,2) = @Branch
and when i add 1 to this code.. it becomes 520000
Although i want to add only the rest 4 DIGIT(9999) to 1 NOT 51
so that it give me 5110000 (adding Dynamically)
I HAVE THE FOLLOWING Query.. Plz Help to Get the Desire Result..
@Branch=51
and Max CODE is 519999
SELECT @Code = @Branch + RIGHT(MAX(Code) ,@DIFAG) + 1
FROM tblmember (NOLOCK) WHERE LEFT(Code,2) = @Branch
Comment