MattSmithProg
Programmer
Hi,
I am attempting to convert a datetime column to the format mm/yyyy. At present I have this
SELECT
CAST(Month(getDate()) AS CHAR(2)) + "/" + CAST(YEAR(getDate()) AS CHAR(4))
However this returns 8/2002 but I want 08/2002. Is there any way to get the month to return a zero at the start if the current month is only a single integer?
Thanks for your help Matt Smith
No two nulls are the same
I am attempting to convert a datetime column to the format mm/yyyy. At present I have this
SELECT
CAST(Month(getDate()) AS CHAR(2)) + "/" + CAST(YEAR(getDate()) AS CHAR(4))
However this returns 8/2002 but I want 08/2002. Is there any way to get the month to return a zero at the start if the current month is only a single integer?
Thanks for your help Matt Smith
No two nulls are the same