How to reset the customer id for every month
I want to reset the customer id for every month. Reset means the id start with 1 for every month starting
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
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
Vicky Bhatt67 reputationPosted Aug 14, 2015, 12:01 AM EDT
select ID, recordDate from TABLE where ID = (select max(ID) from TABLE) where datename(YYYY ,getdate()) = datename(YYYY ,recordDate()) and datename(MM ,getdate()) = datename(MM ,recordDate())