This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I am trying to create an analytic app where user inputs 'MMMYY' (in text) and it will read in the particular SQL table based on the input. (I have an action tool to update the value of the specific string)
However, without them having to enter it again, I would like it so that it can read in a 2nd table, but the YY automatically adjust by 1 year prior.
I was also trying to parse the data and subtract 1 year and put it back in...
I am stumped and the only solution I can think of is asking the user to input 2 different dates (MMMYY)
Basically what this will do is replace the "JUL17" value with the left 3 characters (MMM) of your Text Input, and the right two characters (YY) with the year decremented by 1. Note that this logic may not handle your table format correctly in cases where the year in the Text Input is before 2010. To account for that, you would need to tweak the last bit with a PADLEFT(,2,'0'), as in the example below: