Reading the Date from, date to and Day of week from attached sample excel file, each date has to be written into a new row when the flight operates. 1234567 in the Day of week refer to the Mon Tue Wed Thu Fri Sat and Sun. If you see a number in that field that means the flight will operate on those days of the week between start and end date. I have attached the sample file. sample.xlsx (83.0 KB)
Hi @Sirimalla_Karthik_Chandra,
Use below code to get the difference between 2 dates based on your input file. DateTime.ParseExact(row("Date from").ToString(), "dMMMyyy", System.Globalization.CultureInfo.InvariantCulture) - DateTime.ParseExact(row("Date to").ToString(), "ddMMMyy", System.Globalization.CultureInfo.InvariantCulture)
in Date From column dates are like
Date from
3SEP210
6SEP211
3SEP211
8SEP211
4SEP210
6SEP211
3SEP211
5SEP210
2SEP211
4SEP211
2SEP210
first row has 3Sep210 does that mean 2010?
2.for below 1st row
Date from
Date to
Day of week
3SEP210
05SEP21
56
56 mean Friday and Saturday so you want to list all the dates that are Friday and Saturday between 3 Sep 2010 and 05 Sep 2021 ?
does start date and end date are inclusive for calculating the the days ?
for example if start date is 3 Sep 2021 and end date is 5 Sep 2021, what will be number of days 3rd,4th and 5th Sep or 2 days 3rd,4th/4th,5th Sep ?
From 3 sep 2021 to 5 sep 2021, we have 3 days- friday, saturday and sunday.
so i need to generate dates based on days of week.
I hope you can understand now. sample.xlsx (82.8 KB)