Rhayezelle
Member
hi guys can you please help me with my code.. I'm trying to generate a new ID for every student in my system that will be registered..
for example ( if the last studentID in my database is 3, then i would come up to this new id "0004" in another table for maxID...
but when the student count begins at 25, the result would be like this.. "00025".. I'm trying to implement 4 characters only in generating ID... how can i make it as this "0025"
here's my code...
SELECT format('0') & ('0') & ('0') & (Max([StudentID])+1) AS NewID
FROM Tbl_StudentLevel;
please teach me how to have a better solution for this problem....
for example ( if the last studentID in my database is 3, then i would come up to this new id "0004" in another table for maxID...
but when the student count begins at 25, the result would be like this.. "00025".. I'm trying to implement 4 characters only in generating ID... how can i make it as this "0025"
here's my code...
SELECT format('0') & ('0') & ('0') & (Max([StudentID])+1) AS NewID
FROM Tbl_StudentLevel;
please teach me how to have a better solution for this problem....