Login  Register

Re: reset number after each month

Posted by ErmanArslansOracleBlog on May 18, 2017; 6:13am
URL: http://erman-arslan-s-oracle-forum.124.s1.nabble.com/reset-number-after-each-month-tp2706p2714.html

write your "d"variable in to a file everytime you execute this script. Also everytime you run this script check it like you do for n. (do the check from the file before you write d to a file)
If d is changed, reset your "n" variable to 1.
This is what you need to do.
By doing this you will have;

17 May:
 outputSMS_17052017_01.unl
 outputSMS_17052017_02.unl
 outputSMS_17052017_03.unl
 outputSMS_17052017_04.unl
 outputSMS_17052017_05.unl

18 May:

 outputSMS_18052017_01.unl  --> as you see n goes back to 1
 outputSMS_18052017_02.unl