Using SQL Server 2000
Date like 20120101, 20120201, 20120301...
Fomat is yyyymmdd
I want to display month and year from the date like 01/2012, 02/2012, 03/2012…
Expected Output
01/2012
02/2012
03/2012
I don’t want 1/2012, 2/2012, 3/2012...
Can any one give me a idea or query help….
You can use something like this:
You could “hide” this functionality into a user-defined function to make it more easily usable in your code:
and then you can call this like so:
and get the output