2
Reply

How to reset identity column value on date change in sql ser

Anil Kumar

Anil Kumar

Jan 24 2016 10:29 AM
342
i am creating query for hospital patient opd
i want that opd no shuld be reset and start with 1 on date change like 
Date                       opdNo 
20-01-2016               01
20-01-2016              02
20-01-2016                03
20-01-2016                04
20-01-2016                05
 
21-01-2016                01
21-01-2016                02
21-01-2016                03 

22-01-2016               01
22-01-2016               02
Is it possiable in sql ??
 please help
Thanks 
 
 
 
 
 
 
 
 
 

Answers (2)