static void testCalcDate(Args _args) { TransDate transDate = 20\01\2007; TransDate searchDate; Days day = 2; ; searchDate = dateEndMth(transDate); while(dayOfWk(searchDate) != day) { searchDate--; } print searchDate; pause; }