How to make a member ID ? i want to join 0000, id (autoincrement), DateTime.day, datetime.years(2)
example : Id ={1,2,..}
DateTime= {01/08/2015}
so i have member ID = {000010115,000020115,...}
if you have solution please teach me
thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Amitesh VermaRank #2,535 · 552 reputationPosted Aug 12, 2015, 3:40 AM EDT
select @yearvalue=right(DATEPART(YY,GETDATE()),2)
print @yearvalue
select @Identitydate=IDENT_CURRENT('tablename')
print @Identitydate
set @newid='000'+''+cast(@Identitydate as varchar(5)) +''+cast(@yearvalue as varchar(5))
select @newid