Calculate Date. Date - Date2 = 2 days different
Posted on 2009-02-16
I have a program which i have to run over 2 - 4 days. Its a selection process which selects customers who ordered within a set date. Now im scripting this process as it takes up a week of my time to run the process. However i need all the selections to start on the same date. In the selection fields i have to select t-1095 which is todays date minus 1095 days. however if i run the process the next day i need it to be t-1096 taking into account that another day has passed.
Now i need a way to create a start selection date, so lets say today. 16/02/2009 when i run script 1 today it gives me t-1095 however if i run another script tomorrow it gives me t-1096 and if a wait 10 days it gives me t-1105. I basically need a formula to allow me to set the start date and then give me the difference in days. IE today-startday
I have tried to look at other scripts however my knowledge of data manipulation is limited. I need to be able to do this in a batch file.