I have a MSSql table that has a columns named TodaysDate, UtilityNo, Branch and Batch. I want to write a SQl that starts out with a batch of 1, and when at the 37th row or every 36th , will increment the batch number to 2, etc. I want to update the Batch Column to this number.
So when each Todaysdate --> Branch --> utilityNo gets to row 37 or 73 ... increment and update the batchno in the row. Sounds simple but I am stuck.
Thanks for any solution.