Forum Discussion
MarkShnier
11 years agoQrew Trainee
No problem, Try this
var text YYYY = Totext(Year([SLA Date:]));
var text MM = right("0" & totext(Month([SLA Date:]),2);
$YYYY & "-" & $MM)
This trick is to zero pad the month, so you stick on a leading zero and then take the rightmost 2 characters.
so, 0 becomes 01 and 12 becomes 012 which gets trimmed to 12 when you take the rightmost 2 characters.
var text YYYY = Totext(Year([SLA Date:]));
var text MM = right("0" & totext(Month([SLA Date:]),2);
$YYYY & "-" & $MM)
This trick is to zero pad the month, so you stick on a leading zero and then take the rightmost 2 characters.
so, 0 becomes 01 and 12 becomes 012 which gets trimmed to 12 when you take the rightmost 2 characters.