I’m required to read last month/year from an excel, assigning q1 - q4 as datetime variable & use it to replaces text on a word file with if function.
How do I assign a string to store datetime variable like q1 - q4?
Also, The dates on the excel goes like “jan-18 feb-18”, how do I read the month & year individually?
You can read the complete string at once then use inputstring.substring(0,3) - this will return you month and inputstring.substring(4,2) this will return you year
If you want to get month and year from your excel you can achieve by the way I mentioned previously or you can convert that into convert.datatime(your input string, format) and then you can just get datevariable.month and datevariable.year.