Hello Scott,
Since you know what most everything else does I'm going to focus on this part of the syntax that repeats itself
@Date-@DOM(@Date)-@DOM(@Date-@DOM(@Date))
What this does is it goes to the last day of the month 2 months before the current one. And here is how it does that.
Let's use February 28th 2011 as the current date in this example. So let's substitute that in
2011/02/28 - @DOM(2011/02/28) - @DOM(2011/02/28 - @DOM(2011/02/28))
Now let's solve for @DOM() of today's date
2011/02/28 - 28 - @DOM(2011/02/28 - 28)
2011/02/28 minus 28 is 2011/01/31 so let's substitute that in
2011/01/31 - @DOM(2011/01/31)
Again let's solve for @DOM()
2011/01/31 - 31
and we reach the result of
2010/12/31
Okay now we know that for February 28th 2011 this piece of code below resolves to 2010/12/31
@Date-@DOM(@Date)-@DOM(@Date-@DOM(@Date))
So let's substitute that into the original piece of code.
]|@Year(2010/12/31)|/|@Right("00" + @Str(@Month(2010/12/31)), 2)|/..
Make a bit more sense now?
-Ray