Click here to Skip to main content
15,902,198 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
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
Posted
Updated 24-Jan-16 5:04am
v2
Comments
PIEBALDconsult 24-Jan-16 11:05am    
Of course, but you'll need towrite some code.

1 solution

I guess the opdnr is set by a trigger, so change the trigger logic to your needs.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900